Section 05 - deep tailoring + capability-gap plan authoring (INV-2)
Goal
Replace shallow regex + 8-marker substitution with deep adaptation: generated per-project config from
target introspection (build / test / lint / fmt commands, source roots, paths, domain vocabulary,
architecture), advance the literal→marker migration, and add the capability-gap detector that AUTHORS a
/create-plan plan in the target when a capability is missing for the target’s language. “Tailored”
becomes the rule; “copied verbatim” the exception.
Implementation Sketch
Today adaptation = ordered regex subs from defaults/<type>.json (render.py:170 Tailorer) + an
8-variable closed marker set (config_schema.json:config_vars, mirrored to render.py:75-88) + JSON
topology strip + biome lint-ignore. config_schema.json:5 documents the literal→marker migration as
INCREMENTAL + incomplete; detect_project_type (classify.py:381) picks one of 5 types but derives no
commands/paths. There is ZERO capability-gap → authored-plan path.
- Add a project-introspection step that DERIVES the per-project config values (build/test/lint/fmt
commands, src roots, domain vocabulary) from the target rather than a static
templates/sync-config.template.jsonseed. Generated config feeds the marker set. - Expand
config_vars(the 3-place schema bump:config_schema.json:config_varsSSOT →config_schema.json:harness_config.properties→render.py:KNOWN_CONFIG_VARS) and retire regex rows indefaults/<type>.jsonas token classes migrate to markers. - New capability-gap module: detect when a distributed skill/runtime needs a target-language capability the
target lacks, and AUTHOR a
/create-planplan in the target that adds it. The authoring runs through the canonical/create-planruntime (INV-1: installer’s own runtime), never the target’s. - Retire the byte-parity-vs-legacy gate (
tests/test_byte_parity.py) deliberately with a HISTORY note once tailoring is intentionally deeper than the legacysync.py(not silently).
Spec & Rule References
INV-2 (mission). routing.md §1.0 (capability-gap plan authored via /create-plan, never hand-rolled).
script-first.md §11 (generated config is plan-agnostic). Depends on s-00 bootstrap.
Layer Coverage
Tooling-scope: L1-L11 N/A. L12 = scripts/harness_dist/tests/test_deep_tailor.py driving real generated
config on a fixture target + test_capability_gap.py asserting a real /create-plan plan is authored.
pytest gate: tests/test_config_render.py, test_render.py, test_deep_tailor.py, test_capability_gap.py.
Work Items
- Add a target-introspection step deriving per-project config (build/test/lint/fmt commands, src roots, domain vocab) instead of the static template seed.
- Expand config_vars (3-place schema bump) and retire defaults/
.json regex rows as token classes migrate to markers. - Add a capability-gap detector that authors a /create-plan plan in the target (via the canonical create_plan runtime) when a target-language capability is missing.
- Retire test_byte_parity.py deliberately with a HISTORY note once tailoring is intentionally deeper than legacy sync.py.
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “installable-harness/s-87093bb6” }, “generated_at”: “2026-06-25T15:54:21.647676+00:00”, “graph_state”: { “head_sha”: “b74d6b9a”, “last_code_import_at”: “2026-06-25T15:50:42.204Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:installable-harness/s-87093bb6] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/installable-harness” } } }
(full dossier: deep-tailoring-capability-gap—s-87093bb6.intel.json)