Skip to content

fix: harden runtime contract remediation - #19

Merged
Boulea7 merged 22 commits into
pr/issue5-12-claude-gemini-host-boundariesfrom
pr/issue5-13-runtime-contract-remediation
Apr 12, 2026
Merged

Boulea7 merged 22 commits into
pr/issue5-12-claude-gemini-host-boundariesfrom
pr/issue5-13-runtime-contract-remediation

Conversation

@Boulea7

@Boulea7 Boulea7 commented Apr 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • follows docs: clarify Claude and Gemini host integration boundaries #18 with a narrow runtime-contract remediation wave for issue5 closeout
  • restores shell-safe single-quote command pinning for --cwd and CAM_PROJECT_ROOT so generated CLI/helper commands stop expanding shell metacharacters
  • hardens integrations apply --json staged-write failure reporting and makes directory rollback non-destructive when a target path is unexpectedly a directory
  • keeps session save aligned with the latest primary rollout while still retrying matching recovery markers, and clears shared recovery markers after single-scope reuse
  • fixes memory reindex subcommand option precedence so nested Commander parsing no longer lets parent defaults or parent CLI flags override explicit subcommand values

Included

  • shell-safe quoting updates in retrieval workflow command builders and asset helpers
  • staged-write failure semantics for integrations apply, including accurate attempted/status/action reporting for the failed subaction
  • non-destructive directory rollback handling for staged-write targets that are directories
  • session save provenance ordering and shared recovery-marker cleanup fixes
  • memory reindex nested option parsing fix plus targeted regression coverage
  • contract test updates for source, compiled, and tarball surfaces that still expected the old double-quoted command contract

Excluded

  • no new docs/help boundary wave beyond the minimal test contract updates needed to keep existing release-facing assertions accurate
  • no new Claude/Gemini/generic product-surface changes
  • no broader durable-memory semantic redesign beyond the runtime regressions identified during issue5 review

Verification

  • pnpm exec vitest run test/retrieval-contract.test.ts test/hooks-command.test.ts test/integrations-command.test.ts test/session-command.test.ts test/memory-command.test.ts
  • pnpm exec vitest run test/mcp-command.test.ts test/skills-command.test.ts
  • pnpm lint
  • pnpm build
  • pnpm test:dist-cli-smoke
  • pnpm test:tarball-install-smoke

Stack Notes

  • branch: pr/issue5-13-runtime-contract-remediation
  • base: pr/issue5-12-claude-gemini-host-boundaries
  • head commit: 4cd3898
  • backup refs created before implementation:
    • backup/2026-04-10-pr13-start-pr12-20260410-213026
    • matching backup-tag/...

Review Order


Summary by cubic

Strengthens the runtime contract for issue5 with shell-safe CLI quoting, strict --cwd validation, idempotent cam init --force, read‑only session inspection, clearer integrations failure reporting/rollback, and fixed memory reindex flag precedence. Also makes issue‑tracker keys host/repo aware to avoid cross-host collisions.

  • Bug Fixes
    • Shell-quote --cwd, CAM_PROJECT_ROOT, and PROJECT_ROOT with single quotes and escape embedded quotes; keep resolved/fallback CLI commands aligned with the selected launcher and pinned cwd (e.g., delete-only forget follow-ups).
    • Fail closed on invalid --cwd (empty/whitespace/missing/non-existent) across mcp, integrations (install/apply/doctor), hooks, and skills in source, dist, and tarball CLIs.
    • integrations apply --json: infer which subaction failed; mark it attempted and "blocked" with a clear message; make directory rollbacks non-destructive (preserve directory, mode, and contents).
    • session save: prefer the latest primary rollout over older matching audit provenance; still prefer a matching recovery marker; clear a scope=both marker after single-scope reuse; treat scope=both as matching either single scope; keep session status/load read-only (no memory layout).
    • memory reindex: subcommand flags (--json, --cwd, --scope, --state) override parent memory flags; defaults to scope=all, state=all; enable positional option parsing.
    • cam init: add --force; validate existing project/local config shape; overwrite only when forced; ignore broken user/managed configs outside the project; do not create memory layout; update .gitignore/local ignore.
    • Extractor: build issue-tracker resource keys with non-generic hostname context and repo/ticket info to prevent cross-host collisions and keep same-host distinct tickets separate.

Written for commit 6f11e67. 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 10, 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: af28fcb2-8560-4bcd-a7b9-5d941e86d7ea

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-13-runtime-contract-remediation

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.

@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.

No issues found across 15 files

@Boulea7

Boulea7 commented Apr 11, 2026

Copy link
Copy Markdown
Owner Author

Current stack-hygiene note (2026-04-11): #19 is still UNSTABLE because the remote verify run failed in test/recovery-records.test.ts on the continuity scope assertion (matches continuity recovery records by full logical identity including scope).

This is a stale downstream mismatch rather than a new product regression: #20 already aligned that expectation to the shipped scope=both recovery reuse semantics.

Practical implication for merge planning:

  • if #19 needs to stay independently mergeable, it still needs a tiny refresh/restack to pick up that assertion alignment
  • otherwise treat it as an upstream historical slice in the current stack and do not assume its current CI state blocks the later closeout fixes for semantic reasons

@Boulea7
Boulea7 force-pushed the pr/issue5-12-claude-gemini-host-boundaries branch from 7eef3d0 to 72fcd85 Compare April 11, 2026 12:56
@Boulea7
Boulea7 force-pushed the pr/issue5-13-runtime-contract-remediation branch from 4cd3898 to 32e6860 Compare April 11, 2026 12:56
@Boulea7

Boulea7 commented Apr 11, 2026

Copy link
Copy Markdown
Owner Author

Stack hygiene update (2026-04-11): this branch has now been refreshed and the stale test/recovery-records.test.ts expectation was aligned to the shipped scope=both recovery semantics.

What changed:

  • refreshed head: 32e6860
  • the previously failing assertion now expects scope="both" to satisfy a narrower requested scope like "project"
  • local targeted verification passed with pnpm exec vitest run test/recovery-records.test.ts

This means the earlier UNSTABLE state was a stale test mismatch, not a deeper runtime regression.

Updated closeout tail review order is now:

  1. #19
  2. #20
  3. #21
  4. #22
  5. #23
  6. #24
  7. #25 (new tiny tip seam PR for empty-string integration --cwd fail-closed)

Boulea7 added 20 commits April 11, 2026 21:21
…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
@Boulea7
Boulea7 merged commit 961945f into pr/issue5-12-claude-gemini-host-boundaries Apr 12, 2026
5 checks passed
@Boulea7
Boulea7 deleted the pr/issue5-13-runtime-contract-remediation branch April 12, 2026 11:59
Boulea7 added a commit that referenced this pull request Apr 12, 2026
…ediation

issue5 runtime contract remediation
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