fix(scripts): add database-first legacy store guard#91629
Conversation
|
Codex review: found issues before merge. Reviewed June 14, 2026, 10:53 PM ET / 02:53 UTC. Summary PR surface: Tests +8464, Docs -9, Config +1, Other +9786. Total +18242 across 7 files. Reproducibility: yes. Source inspection shows current Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Add focused resolver-call detection and tests, or explicitly narrow the required guard with maintainer approval, before treating this scanner as mandatory database-first automation. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current Is this the best way to solve the issue? No, not yet. The package/check wiring is the right repair shape, but the required scanner should cover current resolver-returned legacy paths or carry an explicit maintainer-approved scope limitation before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ac1042b09b5c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Tests +8464, Docs -9, Config +1, Other +9786. Total +18242 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
7414971 to
d93ece9
Compare
|
Maintainer review after rebase to current The new guard is wired into pnpm check:database-first-legacy-stores
node scripts/run-vitest.mjs test/scripts/changed-lanes.test.ts test/scripts/check.test.ts test/scripts/check-database-first-legacy-stores.test.ts -- --reporter=verbose
git diff --check origin/main...HEADFinding:
Best-fix verdict: acceptable mitigation only if the contract is deliberately narrowed; otherwise too narrow for the documented database-first guard. |
|
Prep update for
Local proof after the prep patch: pnpm lint:scripts
pnpm check:database-first-legacy-stores
node scripts/run-vitest.mjs test/scripts/changed-lanes.test.ts test/scripts/check.test.ts test/scripts/check-database-first-legacy-stores.test.ts -- --reporter=verbose
pnpm format:docs:check docs/refactor/database-first.md
git diff --check
.agents/skills/autoreview/scripts/autoreview --mode localResult: all local proof passed, and autoreview reported |
b6b37af to
e4d52a2
Compare
e4d52a2 to
8d477a1
Compare
|
Land-ready proof for head 34dde2c. Work done before landing:
Local verification: pnpm check:database-first-legacy-stores
pnpm lint:scripts
node scripts/run-vitest.mjs test/scripts/check-database-first-legacy-stores.test.ts -- --reporter=verbose
node scripts/run-oxlint.mjs extensions/memory-core/src/memory/manager-embedding-ops.ts
git diff --check
.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainResult: all local commands passed. The Vitest guard suite passed 468 tests, and the final branch autoreview reported no accepted/actionable findings. GitHub verification:
Known proof gap: no live provider/channel run was needed or performed because this PR changes repository tooling/architecture guard behavior, not runtime provider or channel behavior. |
Summary
check:database-first-legacy-stores, an AST-based guard for legacy runtime state store writes under source, plugin, and package code.Reviewers should focus on the allowlist boundaries and whether the guard catches realistic write shapes without blocking migration/doctor owners.
Linked context
Closes #91628
Related #81402
Requested from the local BUG-004 database-first validation bundle.
Real behavior proof (required for external PRs)
pnpm check:database-first-legacy-stores, but that command was missing, so new legacy runtime state writes could be reintroduced without a focused check.bug-004-database-first-legacy-store-guard.pnpm check:database-first-legacy-stores node scripts/run-vitest.mjs test/scripts/changed-lanes.test.ts test/scripts/check.test.ts test/scripts/check-database-first-legacy-stores.test.ts -- --reporter=verbose git diff --check .agents/skills/autoreview/scripts/autoreview --mode localpnpm check, broad CI, and live provider/channel runs were not run; this is a repository tooling/architecture guard and does not change provider or channel runtime behavior.Tests and validation
pnpm check:database-first-legacy-storespassed.node scripts/run-vitest.mjs test/scripts/changed-lanes.test.ts test/scripts/check.test.ts test/scripts/check-database-first-legacy-stores.test.ts -- --reporter=verbosepassed 73 tests across 2 Vitest shards.git diff --checkpassed..agents/skills/autoreview/scripts/autoreview --mode localreported no accepted/actionable findings.Regression coverage was added in
test/scripts/check-database-first-legacy-stores.test.ts, andtest/scripts/changed-lanes.test.tswas updated to prove the guard is included for core production changes.Risk checklist
Did user-visible behavior change? (
Yes/No)No.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
False positives or false negatives in the architecture guard.
How is that risk mitigated?
The scanner is covered against representative write forms, aliases, path variables, helper APIs, path segment assembly, filename constants, payload false positives, identifier shadowing, and migration/doctor owner exceptions. The guard is also wired into changed checks for source lanes so regressions are caught before broader CI.
Current review state
Next action: maintainer review and CI.
Waiting on CI and maintainer judgment for the allowlist boundaries.
Autoreview findings from earlier local runs were addressed; the latest local autoreview run is clean.