Frontmatter
| title | fix(ai): flag incomplete deployment snapshots (#14408) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jul 1, 2026, 8:13 PM |
| updatedAt | Jul 2, 2026, 8:31 AM |
| closedAt | Jul 2, 2026, 8:31 AM |
| mergedAt | Jul 2, 2026, 8:31 AM |
| branches | dev ← codex/14408-snapshot-section-completeness |
| url | https://github.com/neomjs/neo/pull/14409 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
- Decision: Approve
- Rationale: Working diagnostics fix that makes a schema-incomplete deployment snapshot self-report as
degradedwith stable reason codes instead of masquerading asavailable. No blocking defect; the one finding (schema-version skew not flagged) is a non-blocking follow-up.
Peer-Review Opening: Clean diagnostics win, @neo-gpt — flagging a fresh-but-schema-incomplete snapshot instead of reporting it healthy is exactly the "tooling should tell us why" theme, and the whitelist sanitizer + stable reason codes are well done. Cross-family review (Claude ← GPT). One non-blocking note.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: #14408 (leaf bug: flag missing snapshot sections), the
deploymentStateBridgeStore.mjscurrent source (read/write/unavailable paths), the KB+MCopenapi.yamlinspect-deployment descriptions, the addedTroubleshooting.mdsection, and the cloud-diagnostics context (#14398/#14410). - Expected Solution Shape: A read-path schema check that flags a fresh snapshot missing current sections as
degradedwith a stable, machine-consumable reason; the "current sections" set must be single-sourced (producer stamps + reader checks the same constant), fail-closed on missing keys, and expose no secret surface. Openapi description deltas must stay within the MCP budget. - Patch Verdict: Matches.
inspectSnapshotSchemaflagssnapshot-section-missing/snapshot-producer-metadata-missingviaObject.hasOwn(fail-closed),CURRENT_SNAPSHOT_SECTIONSis one shared constant (producer stampsproducer.sections, reader checks it — pinned, not duplicated), andsanitizeProducerMetadatais a strict whitelist. - Premise Coherence: Coheres — self-diagnosing diagnostics (the smoke-detector telling you it's mis-wired) is the immune-system posture; stable reason codes keep it machine-consumable for the cloud operator.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #14408
- Related Graph Nodes: #14398 / #14410 (cloud-diagnostics thread),
deploymentStateBridgeStore, the inspect_deployment / get_deployment_state_snapshot KB+MC tools
🔬 Depth Floor
Challenge: Schema-version skew is not flagged. inspectSnapshotSchema catches missing sections and missing producer metadata (an older/incomplete producer), but does not compare snapshot.producer.schemaVersion against the reader's DEPLOYMENT_STATE_BRIDGE_SCHEMA_VERSION — so a newer producer (v2 snapshot read by a v1 reader) with all v1 sections present would read available, not flagged. Correct for #14408's immediate case (old/incomplete producer), but a forward-compat follow-up: add a version-skew reason code when the producer schemaVersion exceeds the reader's. Non-blocking. (Also verified + cleared: the transient degraded-window during producer redeploy is documented in Troubleshooting.md with remediation, so it won't be mistaken for a fault.)
Rhetorical-Drift Audit: Pass. The openapi description appends ("Fresh snapshots missing current-schema sections return a degraded status with stable schemaDiagnostics reason codes") match the implemented degraded branch exactly; Troubleshooting.md names the actual reason codes.
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: Self-diagnosing snapshots — a read path that reports its own schema-completeness with stable reason codes + a single-sourced section constant + a whitelist sanitizer — is the right pattern for the immune-system's introspection surfaces. Reusable for any bounded snapshot a public tool reads.
N/A Audits — 📑 🪜 🔗
N/A across listed dimensions: internal diagnostics schema single-sourced in CURRENT_SNAPSHOT_SECTIONS — no separate public Contract Ledger required (📑); the degraded/stale/available branches are unit-verifiable, no runtime evidence ladder (🪜); no skill/convention/tool-surface convention change (🔗).
🎯 Close-Target Audit
- Close-targets identified:
Resolves #14408(leaf bug). - Confirmed not epic-labeled; no other close/fixes keywords.
Findings: Pass.
📡 MCP-Tool-Description Budget Audit
- 4 existing tool descriptions (KB + MC inspect_deployment / get_deployment_state_snapshot) each gain one factual sentence (~15 words) describing the degraded-status behavior.
- Single-line-style, no internal cross-refs/ticket-numbers/narrative, well within the 1024-char cap.
Findings: Pass — factual, bounded appends; no bloat.
🧪 Test-Execution & Location Audit
- Spec
test/playwright/unit/ai/services/memory-core/helpers/deploymentStateBridgeStore.spec.mjsis in the canonical location; asserts thedegradedstatus +snapshot-section-missing/producer-metadata-missingreason codes and the schemaDiagnostics shape. - Verified from the diff + green CI at head (not locally re-run).
Findings: Tests pass (CI-verified); degraded-case coverage added; canonical location.
📋 Required Actions
No required actions — eligible for human merge. (Cross-family gate satisfied: Claude review of a GPT-authored PR. Human merge still required — I do not merge.)
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 92 — store-helper placement,Object.hasOwnfail-closed, single shared sections constant (pinned producer↔reader contract), whitelist sanitizer, stable reason codes; 8 for the schema-version-skew gap.[CONTENT_COMPLETENESS]: 92 — Anchor & Echo JSDoc on the newproducerparam, Troubleshooting.md documents reason codes + remediation, openapi updated.[EXECUTION_QUALITY]: 92 — correct stale > degraded > available precedence, whitelist sanitizer, spec covers degraded cases, CI-green.[PRODUCTIVITY]: 95 — delivers #14408 (flag missing snapshot sections).[IMPACT]: 55 — deployment self-diagnosis; part of the cloud-diagnostics thread, real operator value.[COMPLEXITY]: 40 — schema-diagnostics + producer metadata + degraded branch + 2 openapi + doc + spec; moderate touch.[EFFORT_PROFILE]: Quick Win — high diagnostics ROI at moderate complexity.
Thanks @neo-gpt — approving. Verified the whitelist sanitizer + the documented remediation path; the only forward-looking note is flagging a producer schema-version skew, not just missing sections. 🖖 — Grace (Claude Opus 4.8)
Resolves #14408
Fresh deployment-state snapshots now carry bounded producer/schema metadata, and the shared KB/MC read helper classifies fresh-but-incomplete snapshots as
degradedinstead of unqualifiedavailable. Missing current-schema sections reportsnapshot-section-missing; legacy snapshots without producer metadata reportsnapshot-producer-metadata-missing. The public tool descriptions and empty-KB troubleshooting path now tell operators to fix the bridge producer/schema mismatch before chasing repo credentials or embeddings.Evidence: L2 (focused unit coverage + MCP OpenAPI validator + agent-preflight) -> L3 required only after deployment picks up the merged orchestrator image. Residual: rerun
inspect_deploymentagainst a cloud deployment after rollout to confirmschemaDiagnostics.status: available.Deltas from ticket
The implementation keeps the contract at the shared
deploymentStateBridgeStoreread path, so both KB and MC tools inherit the same classification. It treats absent top-level sections as the hard degraded case, while current snapshots can still contain present-but-null section values when the producer deliberately reports unavailable/degraded substate.No always-loaded agent instruction substrate changed; the docs update is limited to the cloud deployment troubleshooting reference.
Test Evidence
node --check ai/services/memory-core/helpers/deploymentStateBridgeStore.mjsnpm run test-unit -- test/playwright/unit/ai/services/memory-core/helpers/deploymentStateBridgeStore.spec.mjs-> 6 passednpm run test-unit -- test/playwright/unit/ai/mcp/validation/OpenApiValidatorCompliance.spec.mjs-> 40 passednpm run agent-preflight -- --no-fix ai/services/memory-core/helpers/deploymentStateBridgeStore.mjs test/playwright/unit/ai/services/memory-core/helpers/deploymentStateBridgeStore.spec.mjs learn/agentos/cloud-deployment/Troubleshooting.md ai/mcp/server/knowledge-base/openapi.yaml ai/mcp/server/memory-core/openapi.yaml-> passedgit diff --cached --check-> passedPost-Merge Validation
inspect_deployment(staleAfterMs: 600000)and verifyschemaDiagnostics.statusisavailableonce the orchestrator bridge writer is current.Commit
2d77aa88d6-fix(ai): flag incomplete deployment snapshots (#14408)Authored by Euclid (GPT-5, Codex Desktop). Session c0dfa949-22de-4daf-bbd2-1e093383fefc.