Conversation
8ab3eb4 to
04ff5dd
Compare
|
Note for whoever runs the unit tier locally on this branch, so 12 failures are not
Same file, same count, with this PR's tool absent from the baseline tree. Two Two measurement traps I hit establishing that, in case they save someone time:
Scope of what this PR verified: |
04ff5dd to
a35f13c
Compare
|
@apackeer @leandrodamascena — would you mind taking a look when you have a moment? Tagging you two specifically because of what it touches:
Two things worth a second opinion:
|
a35f13c to
0a4b7f6
Compare
0a4b7f6 to
a53b986
Compare
a53b986 to
ca08d17
Compare
What
aidlc engine dev-context <kind> <id>emits the resolved context for editing onepiece of the framework, instead of leaving you to walk the prose for it.
Why
The runtime already refuses to walk prose to answer "what applies here?" —
graph compileresolves it once and the orchestrator reads the answer off thenode, the discipline
docs/reference/02-plane-architecture.mdstates as "filterevaluation never happens at packet rate". Whoever edits a stage gets no such
service: they open the stage file, guess which protocol modules apply, find the
persona, then its knowledge dir, then the scope grid, then the covering tests,
then the doc chapters. This applies the existing compile boundary one plane out,
to the developer.
For a stage it emits the resolved graph node, the protocol modules that actually
apply, lead/support persona paths and the lead's knowledge dir, compile-resolved
sensors and rules, which scopes execute it, the covering tests, and the doc
chapters that name it.
Measured on
stage:requirements-analysis: ~574 tokens, against ~67k for theseven files a first-time reader actually opens to answer the same question.
The bundle replaces the search for what applies — not the reading of whatever you
then decide to change.
Design notes
It adds no source of truth. Everything is derived from artefacts the build
already produces (
stage-graph.json,tests/.coverage-registry.json, the shippedagent/sensor trees), so a stale bundle means a stale
bun scripts/package.ts.Engine-namespaced, not a public verb. The public surface is deliberately six
install-lifecycle commands, pinned by an exact-list assertion in t230. Widening the
product's front door is a maintainer call, so this sits with
graph,runtime, andsensor. Promoting it later is a one-line route change.Two things are mirrored rather than derived, and are labelled as such:
cannot be imported (it needs live workflow state). t340 re-derives the engine's
three conditions over every shipped stage and compares, so a change there fails
in the test rather than silently skewing every bundle.
resolveReviewClass()lowersit per scope
reviewCapand honours aReview Overridestate field, and adeveloper query has neither, so the output says
(declared)and points at theresolver.
Paths follow the tree you are in:
core/in a source checkout (what you edit,per AGENTS.md), the harness directory in an install. Verified both, including that
every emitted path exists on disk in each mode. Coverage and doc sections need a
source checkout and report themselves unavailable otherwise rather than vanishing.
Coordination with #1115 — please read before merging
#1115 replaces
loadDelegate's switch withDELEGATES: Record<ToolFile, () => Promise<DelegateModule>>, where a missing entryis a tsc error. That is strictly better than the mechanism here, and it deletes
every
case TOOLS.x:line.This branch adds
case TOOLS.devContext:because without it the tool isunroutable on the compiled/native channel — dev-mode
bun <tool>spawns directly,so the gap is invisible until the binary runs. That is the same class of bug #1115
exists to fix (#1070,
reviewBrief), not a duplicate of its fix: different tool,different line.
On merge order: if #1115 lands first, this needs one entry —
"aidlc-dev-context.ts": () => import("./aidlc-dev-context.ts")— instead of thecase. t340's registration check deliberately accepts either spelling, so it staysgreen across that landing. Happy to rebase whenever #1115 is ready.
Verification
bun run check— packaging deterministic across two independent builds for allseven harnesses, 3 typecheck projects, lint over 771 files: clean.
bun test tests/unit/t340-dev-context.test.ts— 9/9. Both new pins werenegative-controlled: breaking the protocol rule fails t340, and removing the
delegate registration fails it. A first attempt at the registration pin was a
behavioural probe through the dispatcher; it passed with the registration removed
(dev mode spawns rather than resolving the table), so it was replaced.
moved 70 → 71, which t239 derives from disk.
dispatcher as well as direct invocation.
dist/claude/.claudeoutside any checkout.Verified on macOS; CI covers Linux and Windows.
Not included
No release metadata: per
AGENTS.md§ Release Metadata Policy (#1096), feature PRsdo not touch
aidlc-version.ts, the README badge, orCHANGELOG.md.Whole-registry delegate exhaustiveness is #1115's. Sharing one protocol-module
resolver between the engine and this tool would remove the mirroring entirely, but
that edits the engine's directive build and belongs in its own PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.