Repository navigation
Add reliability gate manifest - #7001
Conversation
Co-authored-by: Orca <[email protected]>
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you:
Chapters generated by Stage for commit a642c73 on Jul 1, 2026 8:45am UTC. |
📝 WalkthroughWalkthroughRelated Issues: Not specified ChangesThis PR adds a new reliability-gates JSONC manifest, a Node.js validator with tests, a lint script hook, and two reference documents. The manifest defines five gates plus policy thresholds. The validator parses and checks the manifest, including per-gate and policy-level rules, and the test suite covers success and several failure cases. The lint command now runs the new check. The two docs add an implementation plan and a broader reliability pain-points analysis. Sequence Diagram(s)sequenceDiagram
participant CLI
participant main
participant jsoncparser as jsonc-parser
participant Manifest as reliability-gates.jsonc
CLI->>main: run check:reliability-gates
main->>Manifest: read file
main->>jsoncparser: parse manifest
jsoncparser-->>main: parsed gates or errors
main->>main: validate schema/gates
main-->>CLI: exit code 0 or 1
Estimated Code Review Effort: 3/5 Poem: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (5)
docs/reference/reliability-gates-implementation-plan.md (2)
31-31: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional style nit: adverb placement.
"Both gates already have targeted tests" reads fine, but "Both gates have already targeted tests" or "Both gates have targeted tests already" would place the adverb closer to the verb per the style hint. Very minor—feel free to ignore.
55-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider acknowledging all manifest maturity levels.
The manifest defines five maturity levels (
experimental,soak,blocking,accepted-gap,deprecated), but the doc only discusses the three active promotion states. As the reference implementation plan, a brief note aboutaccepted-gap(intentionally deferred) anddeprecated(superseded/removed) would help readers understand the full factory contract without reading the JSONC schema.config/scripts/check-reliability-gates.mjs (2)
9-9: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win
policyblock is declared but never validated; maturity list is duplicated instead of derived.The manifest defines
policy.maturityLevels(config/reliability-gates.jsonc line 5) as the source of truth for valid maturities, but the script hardcodes its ownMATURITIESset instead of reading frommanifest.policy.maturityLevels.main()also never checks thatpolicyexists or thatblockingPromotionfields (minimumSoakRuns,minimumSoakDays,maximumUnexplainedFlakes) are well-formed. If the manifest's policy is edited independently, the validator won't catch the drift or malformed policy content.♻️ Suggested direction
-const MATURITIES = new Set(['experimental', 'soak', 'blocking', 'accepted-gap', 'deprecated']) +// Derive from manifest.policy.maturityLevels once parsed, instead of hardcoding.Add a
validatePolicy(manifest, failures)helper called frommain()that checksmanifest.policyis a record,maturityLevelsis a non-empty string array, andblockingPromotionfields are finite non-negative numbers — then buildMATURITIESfrom that array for use invalidateGate.Also applies to: 121-141
121-133: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueUnguarded
fs.readFilesurfaces a raw stack trace instead of a structured error.If the manifest is missing/unreadable, this throws before reaching the script's own error-reporting path (lines 156-161), producing a less useful failure message than the rest of the tool.
🛡️ Suggested fix
const manifestPath = path.join(root, MANIFEST_PATH) - const raw = await fs.readFile(manifestPath, 'utf8') + let raw + try { + raw = await fs.readFile(manifestPath, 'utf8') + } catch (error) { + console.error(`${MANIFEST_PATH}: unable to read manifest (${error.message})`) + return 1 + }config/scripts/check-reliability-gates.test.mjs (1)
79-90: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider covering the
testFiles-missing and JSONC parse-error branches too.Current test only exercises the
commandshalf of the soak-maturity check (config/scripts/check-reliability-gates.mjs lines 104-109) and doesn't test malformed JSONC input (mjs lines 126-133).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d0179236-a053-49c5-a154-fa0d5a600828
📒 Files selected for processing (6)
config/reliability-gates.jsoncconfig/scripts/check-reliability-gates.mjsconfig/scripts/check-reliability-gates.test.mjsdocs/reference/reliability-gates-implementation-plan.mddocs/reference/reliability-pain-points-2026-06-30.mdpackage.json
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Summary
config/reliability-gates.jsonc, a checked-in registry of reliability invariants, owners, maturity, commands, budgets, gaps, and promotion criteriaWhy We Need This
The recent terminal, tab, provider-session, startup, and performance regressions cut across several parts of the app. A normal test file can prove one behavior, but it does not tell future reviewers which outage class it protects, whether the coverage is mature, who owns it, or what gaps remain. This PR creates that shared reliability map so future PRs can be reviewed against named invariants instead of tribal memory.
What This Actually Does
This PR does not replace normal tests and the manifest is not the test runner. The manifest is the map that tells reviewers and factory agents which reliability promise a test protects, who owns it, when to run it, how mature it is, and what evidence is still missing before it can block merges.
A regular test can say "this behavior passes today." The manifest adds the missing operational context: "this test protects stale terminal snapshot teardown," "this one protects provider-session replay ownership," "this gate is only soaking," and "this gap still needs Electron or provider-contract coverage."
The validator checks the structure of that registry: every gate must declare its invariant, command/test files where applicable, owner, maturity, runtime budget, flake/red-green evidence status, known gaps, promotion criteria, and demotion rule. That makes reliability coverage visible and reviewable instead of scattered across anonymous test files.
Stack Order
This stack is intentionally split so the registry lands first, then each reliability class gets its own focused gate.
Add reliability gate manifest #7001 adds the reliability gate registry and validator. It creates the place where reliability promises are named, owned, matured, and tied to commands. It does not itself prove every terminal/session behavior; it makes the proof plan explicit and machine-checkable.
Contain xterm addon failures to terminal panes #7004 adds the xterm addon containment gate. It proves failures in terminal add-ons such as search decorations, link handling, and WebGL fallback stay scoped to that pane/add-on instead of taking down the whole terminal surface.
Add terminal snapshot freshness contract gate #7005 adds the terminal snapshot freshness gate. It proves an old liveness answer cannot close a newer PTY binding that appeared after the liveness check started.
Prove visible terminal size convergence #7006 adds the terminal geometry convergence gate. It proves visible terminal sizing can recover from bad first measurements, hidden-to-visible layout timing, and dropped provider size application without unbounded resize loops.
Add persisted session upgrade fixture gate #7007 adds the persisted-session upgrade fixture gate. It proves an older saved workspace/session shape can hydrate through the current schema/store path without blank replacement tabs, duplicate tabs, lost wake hints, or eager startup spawning.
Expand provider session replay ownership gate #7008 adds the provider session ownership/replay gate. It proves workspace activation does not replay an agent/provider session that is already owned, queued, pending, or live in that workspace.
Product Code vs Gate Coverage
Most of the stack is reliability gate coverage: manifest entries, deterministic harnesses, and fixtures that make recent regression classes visible in CI and review. Two child PRs also include targeted product hardening:
The other child PRs are primarily gate/test additions around behavior that already exists or known gaps we want to track:
Tests In This Stack
This foundation PR registers the first reliability gates and validates the registry. Some registered gates point at existing targeted tests; the child PRs add or strengthen the behavioral tests that make those gates useful:
terminal-session.snapshot-freshnesswith a provider-contract harness for stale liveness snapshots.agent-session.provider-ownershipwith queued, pending, and live provider-session ownership cases.terminal-geometry.visible-convergence.So this PR is the reliability gate registry and validator; the stacked PRs are where the first concrete regression gates are added or expanded.
ELI5
We keep having similar reliability bugs because we do not always turn the lesson from one escape into a repeatable check. This PR creates the checklist and checker for those lessons: each risky area gets a named rule, an owner, the command that proves it, and a note about what evidence is still missing before it can block merges.
Merge Order
Merge this PR first. It is the foundation branch for the reliability-gate stack and the child PRs are currently based on it.
After this merges, merge or retarget the child PRs on top of
main:The child PRs are intended to be independently reviewable after this foundation lands. If more than one child touches
config/reliability-gates.jsonc, later child PRs may need a normal rebase/retarget conflict fix after earlier children merge.Why These Tests Stay Useful
pnpm run check:reliability-gatesthen exercises the same structural contract reviewers and factory agents rely on.Validation
Follow-up Stack
Child PRs add the first concrete harnesses and update this manifest with red/green, flake, runtime, and perf evidence before any gate becomes blocking.
Made with Orca 🐋
Post-PR Stabilization