Repository navigation
feat(context): prepare isolated Claude native generations - #3452
Conversation
ECC Tools / Security EvidenceCommit: Security evidence gate passed (success) No security-sensitive scanner-evidence gap detected. Mode: enforce Scanned 9 changed file(s). No missing scanner-evidence signal was detected. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / PR Risk TaxonomyCommit: PR taxonomy review recommended (neutral) Detected 1 PR taxonomy bucket(s): CI/CD Recommendation. Scanned 9 changed file(s). Roadmap taxonomy buckets: CI/CD RecommendationCI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work. Signals:
Paths:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Reference Set ReadinessCommit: Reference set readiness gaps detected (neutral) Reference evidence present for 0/7 areas (0%) across 9 changed file(s). This check is based on files changed in this PR. Repository-level readiness is still reported by
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Hosted Promotion ReadinessCommit: Hosted promotion readiness passed (success) No hosted promotion evidence gaps detected across 9 changed file(s); 0 corpus scenarios had matching evidence. This check compares PR file changes against the evaluator/RAG promotion corpus in No evaluator corpus scenarios matched this PR. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used📚 Code guidelines (3)📓 Path-based instructions (4)Focus on command injection, unsafe subprocess usage, path traversal, SSRF, secret exposure, and missing tests for new CLI behavior.⚙️ CodeRabbit configuration file Files:
Source excerpt: Source excerpt: Use **security-reviewer** skill for comprehensive security audits📄 CodeRabbit inference engine (.cursor/rules/typescript-security.md) Files:
Source excerpt: Use spread operator for immutable updates: Source excerpt: Use async/await with try-catch: Source excerpt: Use Zod for schema-based validation: Source excerpt: Use proper logging libraries instead📄 CodeRabbit inference engine (.cursor/rules/typescript-coding-style.md) Files:
Source excerpt: **console.log audit**: Check all modified files for `console.log` before session ends📄 CodeRabbit inference engine (.cursor/rules/typescript-hooks.md) Files:
🔇 Additional comments (2)
📝 SummarySummary by CodeRabbit
WalkthroughNative context profiles now support isolated Claude generations alongside Codex. Provider-specific preparation, verification, status, rollback, and task or interactive launch paths use the selected provider’s executable and isolated configuration. ChangesNative context profiles
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant ProfileCLI as Profile CLI
participant NativeProfile as context-profile-native
participant ClaudeCLI as Claude Code CLI
participant Receipt as Native profile receipt
ProfileCLI->>NativeProfile: Prepare selected Claude target
NativeProfile->>ClaudeCLI: Check version and validate plugin
NativeProfile->>ClaudeCLI: List plugins and inspect plugin details
ClaudeCLI-->>NativeProfile: Return version and discovery reports
NativeProfile->>Receipt: Record verified generation
Merge Risk: ⚪ Minimal · up to Claude profiles use an isolated, verified carrier across preparation and launch. No actionable merge-blocking risk is established in the reviewed changes; proceed with normal project checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Claude sessions use a verified carrier copy, a dedicated configuration directory and a restricted environment. No introduced security bypass was established. Readiness remains narrower than complete session isolation: project configuration and provider policy can still affect execution, and some lifecycle behavior has only source-level verification. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🔇 Additional comments (9)
docs/design/context-profile-delivery.md (1)
71-79: LGTM!docs/design/context-profile-delivery.tdd.md (1)
91-100: LGTM!scripts/lib/context-profile-native-executable.js (1)
17-39: LGTM!tests/lib/context-profile-native-claude.test.js (1)
1-234: LGTM!scripts/lib/context-profile-commands.js (1)
122-124: LGTM!Also applies to: 166-166
scripts/lib/context-profile-interactive.js (1)
83-95: LGTM!scripts/lib/context-profile-launch.js (1)
12-12: LGTM!Also applies to: 26-39
scripts/profile.js (1)
33-33: LGTM!Also applies to: 45-50
scripts/lib/context-profile-native.js-304-306 (1)
304-306: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Reject
k-suffixed token projections, or record them as rounded values.The regex accepts values such as
~35.6k tokonly when no decimal point is present. A35.6kvalue does not match. A value of36kparses as36000. The receipt then records a rounded value as if it were an exact count. The Full profile projection in the TDD ledger is 35,658 tokens. If Claude Code prints that value with aksuffix, the recorded value loses precision. A decimal value fails preparation with "token projection is unparseable" and blocks Full preparation.Do one of these:
- Accept decimals with
kand recordrounded: true.- Reject the
ksuffix explicitly so the fail-closed behavior is intentional.Neither path is covered by tests.
Proposed fix
- const projection = lines.map(line => /^\s*Always-on:\s+~?(\d{1,3}(?:,\d{3})*|\d+)(k?) tok\b/.exec(line)).find(Boolean); + const projection = lines.map(line => /^\s*Always-on:\s+~?(\d{1,3}(?:,\d{3})*|\d+(?:\.\d+)?)(k?) tok\b/.exec(line)).find(Boolean); if (!projection) throw new Error('Native Claude token projection is unparseable'); - const tokens = Number(projection[1].replace(/,/g, '')) * (projection[2] ? 1000 : 1); + const tokens = Math.round(Number(projection[1].replace(/,/g, '')) * (projection[2] ? 1000 : 1));
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: affaan-m/ECC/.coderabbit.yaml
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
969e5c3a-50e8-428d-96dc-40a2cbfa3325
📒 Files selected for processing (9)
docs/design/context-profile-delivery.mddocs/design/context-profile-delivery.tdd.mdscripts/lib/context-profile-commands.jsscripts/lib/context-profile-interactive.jsscripts/lib/context-profile-launch.jsscripts/lib/context-profile-native-executable.jsscripts/lib/context-profile-native.jsscripts/profile.jstests/lib/context-profile-native-claude.test.js
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📚 Code guidelines (3)
.cursor/rules/typescript-security.md — auto-discovered
.cursor/rules/typescript-coding-style.md — auto-discovered
.cursor/rules/typescript-hooks.md — auto-discovered
📓 Path-based instructions (4)
Focus on command injection, unsafe subprocess usage, path traversal, SSRF, secret exposure, and missing tests for new CLI behavior.
⚙️ CodeRabbit configuration file
Files:
scripts/lib/context-profile-interactive.jsscripts/lib/context-profile-native-executable.jsscripts/lib/context-profile-commands.jsscripts/lib/context-profile-launch.jsscripts/profile.jsscripts/lib/context-profile-native.js
Source excerpt: Source excerpt: Use **security-reviewer** skill for comprehensive security audits
📄 CodeRabbit inference engine (.cursor/rules/typescript-security.md)
Files:
scripts/lib/context-profile-interactive.jsscripts/lib/context-profile-native-executable.jsscripts/lib/context-profile-commands.jsscripts/lib/context-profile-launch.jsscripts/profile.jstests/lib/context-profile-native-claude.test.jsscripts/lib/context-profile-native.js
Source excerpt: Use spread operator for immutable updates: Source excerpt: Use async/await with try-catch: Source excerpt: Use Zod for schema-based validation: Source excerpt: Use proper logging libraries instead
📄 CodeRabbit inference engine (.cursor/rules/typescript-coding-style.md)
Files:
scripts/lib/context-profile-interactive.jsscripts/lib/context-profile-native-executable.jsscripts/lib/context-profile-commands.jsscripts/lib/context-profile-launch.jsscripts/profile.jstests/lib/context-profile-native-claude.test.jsscripts/lib/context-profile-native.js
Source excerpt: **console.log audit**: Check all modified files for `console.log` before session ends
📄 CodeRabbit inference engine (.cursor/rules/typescript-hooks.md)
Files:
docs/design/context-profile-delivery.tdd.mdscripts/lib/context-profile-interactive.jsscripts/lib/context-profile-native-executable.jsscripts/lib/context-profile-commands.jsscripts/lib/context-profile-launch.jsdocs/design/context-profile-delivery.mdscripts/profile.jstests/lib/context-profile-native-claude.test.jsscripts/lib/context-profile-native.js
🪛 ast-grep (0.45.3)
tests/lib/context-profile-native-claude.test.js
[warning] 85-85: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(path.join(result.claudeConfigDir, 'CLAUDE.md'), 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename)
[warning] 143-143: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.writeFileSync(path.join(prepared.claudeConfigDir, 'skills/extra/SKILL.md'), 'extra')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename)
[warning] 153-153: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.writeFileSync(path.join(prepared.claudeConfigDir, '.claude.json'), '{"numStartups":1}')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename)
[warning] 179-179: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(path.join(base, 'marketplace/.agents/plugins/marketplace.json'))
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename)
scripts/lib/context-profile-native.js
[warning] 293-293: Detects non-literal values in regular expressions
Context: new RegExp(^${label} \\((\\d+)\\)(?:\\s+(.*))?$)
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).
(detect-non-literal-regexp)
🪛 OpenGrep (1.30.1)
scripts/lib/context-profile-native.js
[ERROR] 28-28: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
[ERROR] 37-37: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
[ERROR] 293-293: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
[ERROR] 304-304: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.
(coderabbit.command-injection.exec-js)
|
ECC Tools / Security EvidenceCommit: Security evidence gate passed (success) No security-sensitive scanner-evidence gap detected. Mode: enforce Scanned 9 changed file(s). No missing scanner-evidence signal was detected. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / PR Risk TaxonomyCommit: PR taxonomy review recommended (neutral) Detected 1 PR taxonomy bucket(s): CI/CD Recommendation. Scanned 9 changed file(s). Roadmap taxonomy buckets: CI/CD RecommendationCI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work. Signals:
Paths:
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Reference Set ReadinessCommit: Reference set readiness gaps detected (neutral) Reference evidence present for 0/7 areas (0%) across 9 changed file(s). This check is based on files changed in this PR. Repository-level readiness is still reported by
Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
ECC Tools / Hosted Promotion ReadinessCommit: Hosted promotion readiness passed (success) No hosted promotion evidence gaps detected across 9 changed file(s); 0 corpus scenarios had matching evidence. This check compares PR file changes against the evaluator/RAG promotion corpus in No evaluator corpus scenarios matched this PR. Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission. |
|
Thank you for contributing this improvement. Merged opt-in isolated Claude profile preparation through the shared registry/receipt contract. Native Claude Code 2.1.296 verified Lean/Full preparation, staleness and rollback without credentials. Authenticated profile task execution remains a separate observation. Delivered through the coordinated integration #3495 on verified main |
Extends
prepare-native,native-status,native-rollback,native-recover,runandstartto managed stores with--target claude, closing the "other-provider activation" gap for Claude.--plugin-dir. No marketplace, install or settings write; a privatehome/.claudeisCLAUDE_CONFIG_DIR. Nonessential traffic and official-marketplace auto-install are disabled for these calls.plugin validate --json, exactly one enabledecc-context-carrier@inlineat the generation path fromplugin list --json, and aplugin detailsinventory equal to the carrier selection with zero agents, hooks, MCP and LSP servers. Copied bytes are re-verified after provider calls; any output drift fails closed.nativeObservation(approximate; plugin listing only, not whole-context truth).stalewhen the store switches to Claude. Evaluator Claude launches without a plugin directory keep their arguments and environment.Real credential-free runs (Linux x64, actual registry): on 2.1.292, Lean ready with 3 skills at ~398 tokens, Full ready with 293 skills at ~35,658, Full excluding
skill:python-patternsready with 292 at ~35,561, profile switch →stale, native rollback restored Lean. Claude Code auto-updated to 2.1.293 during review, which an exact pin rejected; the 2.1 patch range prepared Lean ready on 2.1.293 in 2.4 s (provider calls 1.2 s), re-preparation 0.9 s, status 11 ms.Tests: the RED commits fail; GREEN passes Claude native (27), Codex native (39), interactive (8), launch (12), auto launch (5), evaluation (31), store (31) and profile CLI suites. Full suite: only the three failures that also fail on
mainin my environment. No authenticated model call or interactive turn ran.