Skip to content

S521 — adversarial review of the canonical code-repo rooms draft

S521 — rooms draft review (id-411 {411.1})

Section titled “S521 — rooms draft review (id-411 {411.1})”

Point-in-time record. A review agent was dispatched over the S521 rooms-routing draft for the canonical CODE repo before executing it, because executing means a ~54,000-drawer delete-then-re-mine and DR-113 makes a room change irreversible without a second full re-mine.

Outcome: the draft was NOT executed. Nine blocking changes, two of them semantic. Both mechanism findings below were independently verified at source by the session author before this record was written.

The two mechanism findings that invalidated the author’s projection

Section titled “The two mechanism findings that invalidated the author’s projection”

The author’s projection modelled the router as exact path-part equality and did not model priority 3 at all. Both assumptions are wrong, so the “18/18 assertions passed” result tested a router that does not exist.

M1 — matching is separator-bounded token-set, not string equality

Section titled “M1 — matching is separator-bounded token-set, not string equality”

miner.py:529-549. _TOKEN_SPLIT = re.compile(r"[-_./]+"); _name_matches(a, b) is true when a == b, or b in _tokens(a), or a in _tokens(b).

So every compound name or keyword also matches any path part equal to any one of its tokens:

declaredalso matches
sales-proposalsales, proposal
mcp-evalmcp, eval — so a bare eval/ dir is captured
q-a-pairsq, a, pairs
corpus-searchcorpus, search
entity-managemententity, management
ai-toolingai — so lib/ai/** needs no ai keyword

The last row is the useful half: a compound room NAME matches the same directories at priority 0 while scoring ~0 at priority 3.

M2 — priority 3 is raw substring counting and cannot be disabled

Section titled “M2 — priority 3 is raw substring counting and cannot be disabled”

miner.py:616-629. Every room’s keywords + [name] is content_lower.count()-ed over the first 2000 characters; general is returned only if every room scores zero.

This means short room names are magnets for unrelated content:

  • count("ci") counts citation, decision, specific, efficiency
  • count("data") counts database, metadata

Reviewer’s measurement on the draft: 507 of 2,946 mineable files (17%) were roomed by substring counting, not by path. Worked example: components/content/citation-panel.tsx scores ci: 20 against procurement 1, knowledge 1, data 1 — and routes to ci.

Mitigation: rename short rooms to compound names (cici-cd, datadb-schema). By M1 they still match the path parts ci and data at priority 0, and by M2 they score ~0 at priority 3. Reviewer measured this moving ~185 files off substring routing and raising general from 83 to 188.

  1. sales-proposal swallows the knowledge-admission gate. Keyword proposals captured 23 files under q-a-pairs/dedup-proposals/ — the R2 promotion + dedup + confidence gate named in corpus-reframe-review.html — filing them under an application_type that has no code at all. Same failure class as S520’s reference swallowing reference/decisions/. Fix: keep only sales_proposal; delete proposals.
  2. product_guide is a ratified application_type with live code and no room. app/guide/, app/api/guides/, components/guide/, lib/guides/. The draft’s header claims the domains are the six ratified keys while declaring three. Fix: declare it, or drop the claim — do not ship the mismatch.
  3. deploy/ belongs on pipeline, not ci. The session author had proposed ci and talked the owner out of his own (correct) instinct. reference/deployment-architecture.md frontmatter kh_code_sources lists the compose files beside scripts/cocoindex_pipeline/server.py; reference/cocoindex-pipeline.md:329 cites docker-compose.platform-staging.yaml for the cocoindex sidecar. Carve out deploy/coolify/goose-pilot/**ai-tooling (id-71 {71.26}, DR-044).
  4. mcpai-tooling, keywords [mcp, plugins, goose, eval, anthropic], declared before knowledge. id-71’s surface is “58 MCP tools + 12 resources + 7 prompts + 4 MCP Apps + 8 plugin commands + 7-9 skills + inline AI touchpoints” — six of seven categories are not MCP. platform-direction.md:44: “MCP = connector, Skill = expertise”. DR-044 makes the runtime a per-client choice behind one swappable interface, so naming the room for the connector cannot span the concept. Never use ai (P3 magnet: email, detail, available, main, chain) or claude (collides with .claude under M1).
  5. Do not merge governance into knowledge on a DR-034 citation. See the citation error below.
  1. Declare workflow first, with exclude_paths: [".claude/plugins/*", ".claude/plugins/**"]. Ten nested .claude/ dirs exist; declaration order otherwise scatters 66 dev-workflow files into data (32), mcp (19), ci (9) and knowledge (6). An exclude_paths hit skips only that room and continues the priority loop (miner.py:598-600).
  2. Rename cici-cd and datadb-schema — the M1/M2 trick above.
  3. Drop coverage from knowledge. Directories named exactly coverage are in SKIP_DIRS (palace.py:44) and are never mined; its only live capture is mcp-apps/coverage-matrix/, which DR-034’s S499 amendment rules in scope of the retirement (removal tracked in tasks/id-373.md).
  4. Rule explicitly on scripts/tests/ — 99 Python pipeline tests currently route to tests, not pipeline, because tests ∈ tokens("__tests__") and no path part says cocoindex. Domain-over-kind silently fails there.

The citation error (author’s, corrected)

Section titled “The citation error (author’s, corrected)”

CLAUDE.md commit 470ec4ee recorded “review and governance are ONE concern” and cited DR-034. DR-034 says the opposite of what it was cited for: it retires the content_items-era coverage feature while explicitly retaining governance (“the coverage signals critical to retain are template-completion coverage and governance”). It makes no claim about the two being one concern.

The note also contradicted DR-041, which is in force and separates them at the top level of the three-zone IA (“curation surfaces live in Governance”).

The closest live support for the merge is id-71 {71.9}‘s single faceted queue (facet: content_quality|governance|all) — and that subtask records the two route layers as unchanged.

Resolved after this review, from the schema — the owner’s position was right and no DR is owed. record_lifecycle (ID-131 {131.6}, 20260628190000_id131_record_lifecycle_facet.sql) names its first axis “Review/Governance axis” — ONE axis, spanning {source_document, q_a_pair}. The genuinely separate axis is freshness/expiry/review-cadence, source_document-only (D7). The /review vs /api/governance/review split matches neither axis, since /api/review/ carries cadence and assignments. Final wording 63602df9, superseding 470ec4ee and 93d2774b.

Note the review’s own Q1(c) verdict — “argue it as an amendment to DR-041” — was directionally right (the DR-034 citation was bad) but landed on the wrong remedy, as did 93d2774b. DR-041 rules on navigation zones, not concern boundaries. The authority for this class of fact was a migration all along.

This is the failure shape reference/platform-context.md names explicitly: “Following a citation instead of opening it… When a verdict rests on ‘doc A says X per doc B’, read doc B.” It occurred in the same session that quoted the rule into a sub-agent dispatch brief.

Confirmed sound (stated plainly, not padding)

Section titled “Confirmed sound (stated plainly, not padding)”
  • No room name or keyword enshrines retired vocabulary. Checked against DR-038 (workspace tier), DR-034 (content_items), and “bid is a form_type, not an application”. workspace, content_items, bid are absent throughout.
  • okf belongs in the knowledge layer, not as a domain. Not among the six application_types (entity-glossary.md:14); platform-direction.md:42 puts the OKF bundle on the canonical-output side; DR-041 places Concepts in the Knowledge zone.
  • Domain-over-kind ordering works as designed__tests__/components/procurement/**procurement (43 files). Only 537 of 873 __tests__ files reach tests, which is the stated intent.
  • Name-keyed-not-position-keyed is the correct reading of DR-113/DR-114 and is what makes the config survive the in-flight domain migration.
  • wing: and all four exclude_patterns carried forward byte-identically from the live canonical/mempalace.yaml.

Priority 0/1/2 simulation is exact. Priority 3 depends on the miner’s pre-chunk normalisation of the first 2000 characters, which the reviewer approximated with raw file text — direction and magnitude of the substring-magnet findings are not in doubt, but per-file P3 assignments are indicative, not exact.

The draft looked well-grounded: it cited the entity glossary, quoted the containment chain, and shipped with a passing assertion suite. It was still wrong, because the assertion suite encoded the author’s model of the router rather than the router. Re-implementing detect_room from source was what turned a plausible config into a measured one.