This roadmap is aspirational. Only Phase 1, the deterministic benchmark harness
(Phase 1.5), the deterministic inspection command (Phase 1.6), deterministic Phase 1.7
prepare / recommendation / chunk-inventory / lexical-selection / benchmark-coverage /
boundary-ADR slices, and the Phase 2 disabled semantic retrieval boundary scaffold are
implemented today. No semantic retrieval execution, embedding generation, vector search, or
model-assisted retrieval phase is present in the code, and the documentation never describes a
later phase as if it were.
tiktoken with an honest approximate fallback.tiktoken would otherwise perform; exact
counting requires locally cached encoding assets, and otherwise falls back to a clearly
labelled approximate count (ADR 0008).OptimizationReport (schema_version 1.0) and a lcc CLI (optimize, bench).lcc.benchmarking, lcc bench) that runs the pipeline over
committed cases in benchmarks/cases/ and reports mechanical metrics: token savings,
compression ratio, character reduction, exact/approximate token mode, literal marker
preservation, and warnings — with explicit per-case thresholds and a versioned,
deterministic JSON/Markdown report (ADR 0007).lcc inspect INPUT analyzes a text input (file or stdin) and emits a deterministic JSON
diagnostic report (schema_version 1.0) covering its token, structure, duplication,
cleanup, and cost profile, plus a clearly-labelled projection of what the safe cleaning
in lcc optimize would remove (ADR 0009).action, reason_codes,
summary, and suggested_command when applicable), compact human output via
--summary compact, projected cost savings when pricing is available, and per-stage safe
cleanup contributions for normalization, boilerplate removal, exact deduplication, and
near-deduplication.The implemented deterministic slices keep lcc useful without requiring a local LLM, while
leaving room for an optional model-assisted layer later. The user-facing goal is one
low-friction command that answers: “Should I optimize this context, and, if useful, what
deterministic prompt package should I send next?”
Implemented so far:
lcc prepare INPUT --question "..." runs inspection first for file or stdin input.skip or manual_review, prepare emits or writes the
inspection report and generates no prompt.optimize_safe or optimize_with_flags, prepare can apply
deterministic question-aware lexical selection, then runs the existing safe optimization
pipeline on literal source chunks and can write the optimized prompt plus optimization
report.--output and --report are rejected when they point to the input file, so preparation
never overwrites its source.chunk_inventory with stable IDs, character
offsets, line spans, paragraph counts, per-chunk token counts and methods, simple
structural labels, literal heading text when present, and exact duplicate markers.prepare applies deterministic question-aware lexical
selection using keyword overlap, heading matches, rare-term matches, proximity to matched
headings, and exact-duplicate markers from chunk_inventory; the prepare report explains
why each selected chunk was kept.workflow: prepare fixture cases, reports the
inspection action and lexical-selection state, and includes bundled coverage for
selection-applied and selection-not-applied prepare paths.cleaning, token_budget, prompt_builder,
reporting, pipeline, inspection, or benchmarking.cleaning, token_budget, prompt_builder, reporting,
pipeline, inspection, or benchmarking.lcc prepare as orchestration only. Implemented. The command reads the same core
inputs as inspect and optimize, runs inspection first, and then either skips prompt
generation or runs safe optimization based on deterministic recommendation fields. It
introduces no new dependency and makes no model or network call.prepare now selects chunks with transparent lexical signals such as keyword
overlap, heading matches, rare-term matches, and proximity to matched headings. The selector
preserves first-copy evidence, avoids exact duplicate copies when applied, and reports why
each selected chunk was kept.prepare and lexical selection, including required evidence markers, forbidden irrelevant
and duplicate markers, selected-chunk thresholds, skipped-duplicate expectations, and
selection-applied / selection-not-applied paths. These still measure mechanical behavior
only.The first landed prepare slice was lcc prepare without chunk selection or model assistance.
It is historical context for the execution roadmap; the current implemented prepare workflow
also includes the deterministic lexical-selection slice described below.
Acceptance criteria:
lcc prepare INPUT --question "..." runs inspection first.skip or manual_review, the command writes or emits an
inspection report and explains that no prompt was generated.optimize_safe or optimize_with_flags, the command runs the
existing safe optimization path and can write both prompt and report.The next implemented slice keeps recommendations deterministic and explainable without adding
semantic selection. It adds machine-readable scoring signals under the inspection report’s
recommendation field. These signals are diagnostic: lcc prepare still uses only
recommendation.action to decide whether to skip or run the existing safe optimization path.
Acceptance criteria:
The current implemented slice adds deterministic, machine-readable chunk_inventory data to
inspection reports. It inventories non-empty paragraph-like blocks separated by blank lines,
labels Markdown heading blocks as heading, labels other non-empty blocks as
paragraph_block, records 0-based character offsets and 1-based line spans, and marks exact
duplicate chunks by pointing later copies at the first matching chunk ID.
Acceptance criteria:
schema_version remains 1.0.The current implemented slice adds a separate, deterministic selection path to lcc prepare
after inspection has already recommended optimize_safe or optimize_with_flags. Selection
uses the chunk inventory’s stable offsets, labels, literal heading text, token counts, and
exact duplicate markers to evaluate literal source chunks against the question. It does not
change how prepare decides whether to skip or optimize: that decision still comes only from
recommendation.action.
Acceptance criteria:
The current implemented slice extends the deterministic benchmark harness so fixtures can
exercise either the original optimize workflow or the prepare workflow. Prepare fixtures
mirror the command’s deterministic orchestration: run inspection, branch only on
recommendation.action, apply lexical selection only for optimize recommendations, and then
run the safe optimization path.
Acceptance criteria:
workflow: optimize (default) and workflow: prepare.Phase 2 remains planned for retrieval itself. The first accepted boundary artifact is ADR 0011, which defines the disabled-by-default opt-in scaffold for optional local semantic retrieval. The scaffold lives outside the deterministic core, inspection boundary, and deterministic benchmark harness. The retrieval execution contract is recorded in ADR 0012: the first future adapter must be a separate opt-in local-index adapter that returns provenance-rich literal source spans. No retrieval execution adapter is implemented today.
Implemented boundary scaffold:
lcc.semantic_retrieval exposes a standard-library-only boundary status contract.lcc semantic-retrieval reports the scaffold state.semantic_retrieval.enabled defaults to false; enabled requests require explicit local
index and embedding asset paths.semantic-index-1.0 manifest metadata for source
fingerprint, embedding model metadata, positive vector dimensions, deterministic
index_settings, chunk provenance consistency, and local vector file references. Vector
references must be relative, stay inside the manifest directory, and exist locally;
validation does not read vector contents.embedding_assets: asset references must be relative, stay inside the embedding assets
directory, exist locally, and match their declared sha256:<hex> fingerprints.Still planned:
Next real implementation step: implement ADR 0012’s separate local_index_v1 execution
adapter behind explicit opt-in, starting with fail-closed tests. Do not add embedding
generation, index building, vector search in deterministic commands, or prompt integration in
that first implementation.
lcc already produces.evaluation.md).These are explicitly not implemented and are listed here so the docs never imply they exist:
Each, if pursued, lands behind a new, clearly separated boundary; none touches the deterministic core.