← Back to Pull requests

v1 wave 3d: agent memory layer, rulings D-249 to D-254, continuity pointers, W11-INV-SET-MOVEMENT #221

Open
unknown opened this pull request with 577 lines diff across 7 files
View on GitHub
unknown unknown commented on Nov 22, 2026 19:22 UTC
Author

Summary

Wave 3d makes the v1 programme continuable from GitHub alone, by any account or tool, and carries one accepted packet. Under D-253 Track 1 it adds the agent memory layer: briefs, runbook, a generated status file, a per-packet context bundle and a compaction helper, all in the repo. It records the owner rulings D-249 to D-254 and points CLAUDE.md and AGENTS.md at the memory layer. It also lands W11-INV-SET-MOVEMENT.

Related Issue(s)

  • Control room: #80. Rulings D-249 to D-254; the HANDOVER CHECKPOINT comment; the RETURN for W11-INV-SET-MOVEMENT.

  • Memory research: #106 and #126 (sources for the layer's design).
  • Changes

  • Agent memory layer (from pkt/V1-AGENT-MEMORY-LAYER, compacted into one commit). Docs and scripts only.

  • - docs/development/agent-memory/ holds:
    - README.md: the layers mapped to the owner's research;
    - the packet worker, acceptance review and confirmation review briefs;
    - WAVE-RUNBOOK.md and OWNER-QUESTION-FORMAT.md;
    - MEASUREMENT.md.
    - scripts/agent-memory/ holds:
    - status.mjs (generated V1-STATUS.md and .json);
    - bundle.mjs <PACKET-ID>;
    - compact.sh, the helper that turns a packet into one tests-only RED commit and one fix commit (it compacted the packet below);
    - node:test specs.
    - docs/reconstruction/handoff/ORCHESTRATOR-STATE.md was rewritten at 18:55 UTC: standing instructions, every piece of work in flight with its branch and next action, and seven open owner questions.
  • Rulings (BUILD-MAP-001.md):

  • - D-249 to D-252 (SWP-INV-MONEY-TOTALS);
    - D-253 (memory programme, two tracks);
    - D-254 (KEY's memory is built inside v1 once its design is approved).
    - V1-PLAN-RECUT.json gains FU-MARKETPLACE-PAID-PAYMENT-ROW (210 packets) and the D-249..D-252 amendment.
    - KF-MEMORY-CONTEXT-GENOME-STATUS.yaml moves from DEFER_V1_PLUS to IN_V1_PENDING_DESIGN.
  • CLAUDE.md and AGENTS.md.

  • - Continuing agents read the memory layer and state file first.
    - A fallback read command for #80 is added.
    - New rule: nothing needed to continue may live only in a session, a container or a scratch directory. This follows the owner's instruction on 2026-11-22: "ensure every step of the way our work is accessible so that it can be continued by another account or software".
  • W11-INV-SET-MOVEMENT (pkt/V1-W11-INV-SET-MOVEMENT at 3c8193f3, D-139):

  • - Setting stock writes one ADJUSTMENT movement (reason SET, created by the authenticated member) in the same transaction, with the delta computed from the locked read.
    - A quantity below the stored reserved quantity is refused with 400 QUANTITY_BELOW_RESERVED and nothing is written; an edited reserved is refused with 400 RESERVED_NOT_EDITABLE.
    - The Excel import uses the same path and names a skipped row in its error.

    Testing

    Run at d281a2ee, local database only:

  • pnpm lint: server 0 errors (3158 warnings).

  • pnpm build: server build passes.

  • Server tests: full suite 768/768 files, 14118 tests passed. proof:release0: R0 EXIT GATE MET, 39 of 39 manifests, exact-head receipt.

  • Agent memory specs: node --test scripts/agent-memory/tests/*.spec.mjs gives 12 passed, 0 failed. status.mjs --check passes; bundle.mjs is VALID for the new packet at this head.

  • Manual smoke test: not applicable (no web change).
  • Screenshots / Notes

  • First local run discarded. It failed for an environment reason, not code: in a fresh worktree pnpm db:generate was served from turbo's cache and generated nothing (Cannot find module '.prisma/client/default'). After npx prisma generate in packages/db the run above is clean. The runbook note for this will land with the next wave, so as not to move this head after its proof.

  • Reviews.

  • - W11-INV-SET-MOVEMENT: four review rounds per lens in its session, ending in ACCEPT; an independent acceptance review, ACCEPT WITH MINORS on both lenses; its three requested repairs reviewed ACCEPT and proven (768/768, R0 MET at 3c8193f3).
    - The memory layer: one independent review in its session (0 critical; the 6 majors fixed), plus the orchestrator's own check of its specs and scripts.
  • Size. 5 commits and 24 files (limits 25 and 50).

  • Constraints. No schema change, no new dependency, no real provider traffic, nothing deployed.
  • Checklist

  • Code follows the project's style guidelines

  • Self-review completed

  • Comments added for complex logic

  • Documentation updated if needed

  • No secrets or sensitive data committed
  • ---
    _Generated by Claude Code_

    Diff: 577 lines (+432 / -145) across 7 files Reviewer: chatgpt-codex-connector[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.41 = Change Risk (0.55) × (1 − Review Confidence (0.26)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 577 lines diff across 7 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 35% · Reviewer familiarity: 35%
    26%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.380
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #221"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 26.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.8% (MEDIUM) · Higher = larger blast radius
    54.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 26.1% · Lower = rushed or shallow review
    26.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 40.5% · Moderate risk
    40.5%