Orchestrata Ultimate › Plans › briefs › p-archsync-table-correction

P-ARCHSYNC — correct the self-described-architecture table to current doctrine — brief for one qwen3-coder-next run

Source: plans/briefs/p-archsync-table-correction.md at 8a2cb42ad · last changed 2026-10-19 · first committed 2026-10-19 · 99 lines.

Prose pending.

Plan text

P-ARCHSYNC — correct the self-described-architecture table to current doctrine — brief for one qwen3-coder-next run

Authority: Mohamed 2026-10-19 verbatim "we are not using neo4j models get confused make this clear" + the coordinator's P-ARCHSYNC task (session 272). The script scripts/sync_architecture_to_graph.py re-syncs its COMPONENTS table into prod orchkg on every SessionStart hook run — its stale rows actively teach agents a wrong architecture. This packet corrects the table and adds a scoped retirement mechanism for the graph node the corrected table no longer writes.

Model-routing note (RUL-037): .py-fenced brief on qwen3-coder-next by Mohamed's explicit session instruction (stated override; M2 not landed). Coordinator verifies before commit and runs the prod graph step himself. Workers do not commit and never touch prod (10.53.1.*).

Fence — exactly these two files

scripts/sync_architecture_to_graph.py
tests/scripts/test_sync_architecture_to_graph.py

Read both fully first (AST toolkit: source sync_architecture_to_graph --source scripts/sync_architecture_to_graph.py --residue for the module tables; the test file has ~14 neo4j-related assertions to update). No other file. No commit, no git add, no prod connection, no full-suite runs.

Measured doctrine (the correction targets — do not invent beyond these)

  1. The graph engine is orchgraph — Mohamed's Memgraph 3.11 fork, HA cluster (coordinators + main/ replica), Bolt protocol, orchkg database; the Memgraph semantic twin lives in the memgraph database on the same cluster. Neo4j is NOT used: containers destroyed 2026-07-27 (AGENTS.md § Graph Sync Engine; env keys NEO4J_* retired). The neo4j:// URI scheme and the Python neo4j driver package are Bolt-client naming only.
  2. Kernel is REQUIRED — Hard Rule 7 (AGENTS.md): the kernel "must be started AND gRPC-verified for a test run to be valid... never re-flip the kernel to optional". The table's required: False on Kernel contradicts it.
  3. grpcio is retired (2026-08-07, AGENTS.md § Test Standards): the kernel transport is the cxpt direct transport on port 50053; "Gateway connects via gRPC" phrasing is stale. The PipelineKernelClient fallback remains (production resilience path).

Changes

A. COMPONENTS table (the five-row module-level list)

B. Scoped retirement flag (the deletion Mohamed authorized, mechanism-scoped)

Add --retire-legacy <LABEL>:<id> (repeatable) to the parser: DETACH DELETE one node by label + canonical id, project-scoped safety: refuse any id not starting with orchestrata-ultimate:; print the target and the pre-delete property snapshot; exit non-zero if the node does not exist (loud, never silent). This is the ONLY delete path in the script; it goes through the writer's repository (writer._write or the documented public seam if one exists — measure and report which you used; do NOT add a delete method to ArchitectureWriter, that file is outside the fence). Default runs (no flag, and the SessionStart hook) NEVER delete anything. Document in the module docstring: the hook keeps writing the corrected table; --retire-legacy is coordinator-run, one-shot, per authorized correction (Mohamed 2026-10-19).

C. Tests (same fence)

VERIFY (run exactly; report outputs verbatim)

.venv/bin/ruff check scripts/sync_architecture_to_graph.py tests/scripts/test_sync_architecture_to_graph.py
.venv/bin/black --check scripts/sync_architecture_to_graph.py tests/scripts/test_sync_architecture_to_graph.py
.venv/bin/pytest tests/scripts/test_sync_architecture_to_graph.py -o addopts="" -q
grep -c -i '"Neo4j"' scripts/sync_architecture_to_graph.py            # expect 0 (the responsibility sentence may mention Neo4j as retired — table NAME must not)
grep -n "required.*False" scripts/sync_architecture_to_graph.py | grep -i kernel   # expect NOTHING
.venv/bin/python scripts/sync_architecture_to_graph.py --help | grep -A2 retire

Coverage: measure honestly (--cov=scripts --cov-report=term-missing | grep sync_architecture_to_graph), report the number and any gap as a named second-pass item (session priority: finishing outranks perfect 90).

Done

Reply with: the diff summary per change (A/B/C), the constraint-id retirement target you measured, which writer seam the retirement uses, the VERIFY outputs verbatim, the coverage number, and anything you could not execute faithfully, named.