KB-1630

O8D Mac patch / deploy / multi-gap proof — 03-source-survey-patch-plan

3 min read Revision 1
dieu44iu-cutterv0.6o8dmac-patchsource-surveypatch-planmulti-gap-proof

O8D Report 03 — Source survey & patch plan (G2)

  • macro: v0.6-o8d-mac-patch-deploy-multigap-proof
  • date_utc: 2026-05-21
  • gate covered: G2 source survey and patch plan
  • result: G2 PASS

1. Survey findings

Milestone / version constants

cutter_agent/orchestrator/__init__.py lines 33-39 hold __version__ / __milestone__ / __execution_enabled__ / __live_wiring__. Three test files hard-pin the milestone: test_orchestrator_o1_state_machine.py:22 ({O1..O6} set), test_orchestrator_o4_live_dryrun.py:177 (assertEqual …"O4"), test_orchestrator_o2_e2e.py:30 ({O2,O3,O4} set).

cutplan content path (F2)

CutplanRow (discover.py) carried only canonical_address / unit_kind / section_type / content_hash / idempotency_key / sort_orderno body/title. The cutplan phase serialised only those 6 keys into the cutplan_rows pin. The live cut_leg_a adapter guard already required body/title; the O8A test _rows() helper already anticipated an enriched contract (body/title/owner_ref/parent_ref). → producer side missing.

LegB / Verify N=60 pin (F3)

The N=60 pin lives in the v0.5-ratified ledger_v2_canonical_cut.py / ledger_v2_canonical_verify.pyPIN_CANDIDATE_COUNT = 60, EXPECTED_SECTION_TYPE = {principle:15, section:3, article:42}, and the hardcoded key name body_hash_match_60. Generalising these is not localised — it touches ratified code and a literal key name → needs an architecture ruling.

psycopg seam (F1 residue)

ProductionLiveExecutionAdapter drives conn.execute(sql, params) (psycopg v3). VPS has psycopg2 only (no .execute() on the connection).

2. Patch plan — decisions

Patch Item In-scope? Decision
P1 milestone/version ratification + KNOWN_MILESTONES + 3 test relaxations yes, localised PATCH
P2 Psycopg2ConnectionShim (psycopg2→psycopg3 surface) yes, localised, no secret PATCH
P3 F2 cutplan content-contract enrichment (CutplanRow/MarkRow fields, serialisation, guard) yes, localised (additive optional fields) PATCH
F3 LegB/Verify generalisation off N=60 NOT localised — touches v0.5-ratified files + hardcoded key name PACKAGE as gap (G2 rule: needs architecture ruling → do not patch)

3. G2 verdict

version_milestone:   patch (P1)
f2_cutplan:          patch (P3) — contract enrichment localised
f3_recorder:         package (architecture ruling required — not localised)
psycopg_shim:        patch (P2)
g2:                  PASS
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-o8d-mac-patch-deploy-multigap-proof/03-source-survey-patch-plan.md