Implement template system steps 1-3
Author: maurosoriaCreated Aug 14, 2026Updated Aug 14, 2026
Scope: implement only steps 1, 2, and 3 of the template-system roadmap.
1. Expose templates through the CLI
- Add
--wordlist-templatesfor selecting bundled template sources. - Add repeatable
--template-var KEY=VALUEoverrides. - Add
--template-strictto reject unresolved or invalid placeholders. - Add
--template-report FILEfor a machine-readable expansion report. - Preserve existing
-wand--wordlist-categoriesbehavior. - Document the flags and add CLI/config parsing tests.
2. Compile a deterministic template plan
- Add dependency-light
TemplatePlan,TemplateContext, andTemplateSourcedata classes. - Add
compile_template_plan(...)as the validation and planning entry point. - Validate placeholders, variables, and referenced categories before the scan starts.
- Freeze dynamic values such as dates once per plan.
- Estimate expansion cardinality and enforce a configurable budget.
- Make deduplication, ordering, and shard assignment deterministic.
- Preserve source and variable provenance and expose stable
to_dict()output for Python and JSON consumers. - Test strict mode, invalid inputs, budgets, determinism, and serialization.
3. Select templates from preflight evidence
- Add a pure
TechnologyMatcherthat converts fingerprint/preflight evidence into explicit technology matches. - Add a pure
TemplateSelectorthat maps matches to template sources. - Support
--wordlist-templates autowhile exposing selected sources. - Keep selection evidence-based and inspectable; avoid opaque numeric scoring.
- Define a deterministic fallback for missing or ambiguous evidence.
- Include selected templates and supporting evidence in the template report.
- Test known technologies, mixed evidence, ambiguous evidence, and the fallback path.
Completion criteria
- Identical inputs produce identical plans and candidate ordering.
- Python API and CLI expose equivalent structured planning output.
- Template planning/report failures do not corrupt scan state.
- Existing wordlist workflows keep passing their regression tests.
Source: maurosoria/dirsearch