Skip to content

fix: harden release-facing contract closure - #15

Merged
Boulea7 merged 32 commits into
pr/issue5-08-route-truth-contractsfrom
pr/issue5-09-release-contract-closure
Apr 12, 2026
Merged

Boulea7 merged 32 commits into
pr/issue5-08-route-truth-contractsfrom
pr/issue5-09-release-contract-closure

Conversation

@Boulea7

@Boulea7 Boulea7 commented Apr 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • follows PR fix: align route truth and codex integration contracts #14 with a narrow Wave 2 closure focused on release-facing contract stability
  • fixes the top-level cam doctor --json app-server contract so environments without tui / tui_app_server no longer break reviewer smoke
  • hardens integrations apply --host codex --json staged-write failure handling so directory/launcher failures return structured rollback payloads instead of crashing
  • aligns compiled and tarball smoke coverage with the current Codex-only/manual-only host boundaries and runtime helper contract

Included

  • top-level doctor source/compiled/tarball contract coverage for nullable readiness.appServer
  • integrations apply staged-write failure payloads: stackAction: "failed", failureStage: "staged-write", failureMessage, rollback metadata, and directory-aware rollback snapshots
  • packaged launcher / retrieval contract coverage via CODEX_AUTO_MEMORY_DIST_CLI_PATH tests
  • release checklist updates for the two contracts above
  • dist/tarball smoke expectation cleanup for current manual-only host and runtime CAM_PROJECT_ROOT helper behavior

Excluded

  • continuity provenance / selector semantics
  • extractor / reference-topic rule changes
  • memory / remember / session CLI semantic follow-up
  • README-wide or broader docs-contract rewrites beyond the release-facing checks touched here

Verification

  • pnpm exec vitest run test/doctor-command.test.ts test/retrieval-contract.test.ts test/integrations-command.test.ts
  • pnpm build
  • pnpm test:dist-cli-smoke
  • pnpm test:tarball-install-smoke
  • pnpm test:docs-contract
  • pnpm lint
  • pnpm test:reviewer-smoke

Stack Notes

  • base: pr/issue5-08-route-truth-contracts
  • head commit: f552d43
  • backup refs added before implementation:
    • backup/2026-04-09-wave2-start-pr8-20260409-211012
    • backup/2026-04-09-wave2-start-remediation-20260409-211012
    • matching backup-tag/... refs

Review Order


Summary by cubic

Hardens release-facing contracts across source, dist, and tarball CLIs: nullable app‑server in doctor --json, structured staged‑write failure reports, and a portable retrieval workflow. Adds strict --cwd validation, read‑only session inspection, idempotent init, and clarifies Claude/Gemini host and AGENTS.md boundaries.

  • Bug Fixes

    • doctor --json: readiness.appServer is nullable; compiled/tarball checks pass when tui/tui_app_server is absent.
    • CLI safety: all --cwd flags fail closed on empty/whitespace/missing paths and require an existing directory; shell-safe quoting is used in emitted commands; hooks quote PROJECT_ROOT; cam remember rejects empty text.
    • Sessions: session load/status stay read-only on uninitialized projects; continuity recovery prefers pending records and treats scope: both as matching narrower requests.
  • New Features

    • integrations apply --host codex --json: staged-write failures return a structured payload with stage, message, rollback status, and per-subaction attempts across source, dist, and tarball CLIs.
    • Top-level workflow: doctor --json adds recommendedRoute and command hints; retrieval supports a packaged dist launcher via CODEX_AUTO_MEMORY_DIST_CLI_PATH and safely appends --cwd.
    • cam init: explicit, idempotent initialization with config shape validation and isolation from global config; integrations install --host codex installs the stack without updating AGENTS.md; added AGENTS.md and docs clarifying Claude/Gemini remain manual-only snippet hosts.

Written for commit 13f9d7f. Summary will update on new commits.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Boulea7, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Apr 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3077627f-1a31-4826-98c5-2bf6042f5838

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/issue5-09-release-contract-closure

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Boulea7

Boulea7 commented Apr 9, 2026

Copy link
Copy Markdown
Owner Author

Stack note (2026-04-10): pushed a6d689e (test: align manual-host mcp snippet contract) to align test/mcp-config.test.ts with the current manual-host contract: claude / gemini / generic snippets stay read-only and do not expose workflowContract.

Fresh local verification on pr/issue5-09-release-contract-closure:

  • pnpm exec vitest run test/mcp-config.test.ts
  • pnpm test

Keeping this PR as draft while the refreshed remote verify reruns.

@Boulea7
Boulea7 marked this pull request as ready for review April 10, 2026 12:39

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Boulea7, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Boulea7

Boulea7 commented Apr 10, 2026

Copy link
Copy Markdown
Owner Author

Reviewer note (2026-04-10): this PR is now ready for review as part 2 of the active issue5 review stack.

Recommended order: review #14 first, then this PR, then #16 and #17.

Bridge drafts #12 and #13 remain draft and are not part of the primary reviewer path for this wave.

Current head: a6d689e.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/retrieval-contract.test.ts">

<violation number="1" location="test/retrieval-contract.test.ts:40">
P2: These assertions no longer verify the shell-escaping behavior their names describe.</violation>
</file>

<file name="src/lib/commands/integrations.ts">

<violation number="1" location="src/lib/commands/integrations.ts:248">
P1: Rollback for `snapshot.kind === "directory"` can silently delete existing directory contents. The code recursively removes the directory, then recreates it empty, so rollback is destructive instead of restorative.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/lib/commands/integrations.ts
Comment thread test/retrieval-contract.test.ts Outdated
@Boulea7

Boulea7 commented Apr 10, 2026

Copy link
Copy Markdown
Owner Author

Follow-up closeout note for the release-contract wave:

  • The staged-write rollback / failure-shape concerns from this PR were closed by #19 (4cd3898), which hardened integrations apply --json staged-write failure reporting, made directory rollback non-destructive, and corrected failing-subaction attempted/status/action reporting.
  • The remaining runtime-safety leftovers after that were closed by #20 (b2ecfc9) for empty --cwd fail-closed behavior and launcher-aware workflow guidance parity.
  • The still-separate closeout seams after #20 have now been split into:
    • #21 session inspection read-only closure
    • #22 init idempotency / explicit --force
    • #23 Vitest worktree isolation + packaged MCP gate parity

Adding this note so the old review remarks here have an explicit downstream resolution trail instead of relying on stack archaeology.

@Boulea7
Boulea7 force-pushed the pr/issue5-09-release-contract-closure branch from a6d689e to f4150c2 Compare April 11, 2026 12:56
Boulea7 added 15 commits April 11, 2026 22:59
…2026-04-11

issue5 tail closeout blocker fixes
issue5 close remaining runtime and extractor seams
…on-parity

issue5 release gate isolation parity
issue5 init idempotency and force semantics
…sure

issue5 keep session inspection read-only
…ediation

issue5 runtime contract remediation
…oundaries

issue5 claude and gemini host boundaries
…osure

issue5 integrations install AGENTS boundary docs
@Boulea7
Boulea7 merged commit 6764bc1 into pr/issue5-08-route-truth-contracts Apr 12, 2026
5 checks passed
@Boulea7
Boulea7 deleted the pr/issue5-09-release-contract-closure branch April 12, 2026 11:59
Boulea7 added a commit that referenced this pull request Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant