Repository navigation
[3023 by Claude Opus 5.5] Close fail-closed managed diagnostics capture coverage gaps - #3031
Conversation
…stics, launch, admission, network-egress, config and daemon suites pass, including 7 new ones in `packages/core/test/managedDiagnosticsCoverage.test.ts`. Typecheck and lint are clean on the changed source.
1. Provider credential roots
- I moved the launchers' path resolver (`resolveConfigPath` and the Codex variant) into a new database-free module, `packages/core/src/config/agentConfigPaths.ts`. `configManagerAgents.ts` re-exports it unchanged. Diagnostics can now use the launchers' own path rules without loading SQLite.
- The new `diagnostics/providerRoots.ts` returns either the root or an explicit refusal, using the same rules the launchers mount from:
- Codex: `CODEX_CONFIG_PATH`, then `HOST_CODEX_DIR`, else `~/.codex`.
- OpenCode: the data directory, not the config directory.
- Vibe: `VIBE_CONFIG_PATH`.
- Managed accounts: default to `~/.propr/agent-credentials`.
- `HOST_*` variables are no longer required when the launch path itself resolves.
- Refusals are recorded on the `capture` source as `credential-root:<reason>`: `unmapped-default-root`, `relative-root`, `no-mounted-auth-store`, `unsupported-provider` or `missing`.
2. Unterminated final line: a final line without a newline is now captured as a record when the stream closes, instead of always becoming a gap. Only an oversized tail is still a gap.
3. Docker errors and stack traces
- Docker CLI/daemon errors and exception heads (`TypeError: …`, `Traceback …`, `panic: …`) are now accepted on stdout/stderr.
- Each head can carry up to 64 follow-on lines, but only stack-frame shapes (JavaScript/Java `at …`, Python `File "…", line N`, Go frames, `Caused by:`). They export as `{"continuation": …}` and get the same redaction.
- A follow-on line containing `{`/`}` or ending in a credential assignment is rejected, and any other line ends the window. Native log files keep the stricter single-line rules.
- Because exported records change shape, I bumped the redaction version to 2.
4. Environment injected by the network/admission policy: native goal launches (Codex app-server, Claude, Antigravity) were scanning the pre-policy arguments plus the admission `docker start` command. That meant environment variables added by the network rewrite were never checked for secrets. `spawnAdmittedAgent` and `spawnWithNetworkPolicy` now hand the callback the post-policy create arguments and launch environment as a second argument. The final and create arguments are still scanned separately. The scan now handles:
- every Docker env form: `--env=K=V`, `-eK=V`, and `-e K` (value taken from the launch environment).
- passwords embedded in URLs, such as proxy or `GIT_CONFIG_VALUE_*` values.
- `Bearer`/`Basic` header values.
- credential-named fields inside JSON values such as MCP configs.
Docs: `docs/operations/managed-diagnostics.md` has a new "Provider stream capture coverage" section. It covers the root table, the refusal reasons and record outcomes, and the capture shapes I intentionally left unsupported:
- Python source lines printed under a traceback frame
- Node `code: '…'` property dumps
- multi-line JSON
- coloured (ANSI) output
- `--env-file` contents
- secrets under innocuous names with no recognisable shape
Things to check in review:
- Native installs whose worker UID differs from the provider root owner still refuse capture. That's the existing ownership check, unchanged here.
- Two existing tests changed slightly:
- `managedDiagnostics.test.ts` now sets `HOME` to a temp directory, because with the new resolver a real `~/.codex` on the test machine could have made it capture.
- `networkEgressPolicyCoverage.test.ts` now asserts the callback receives the post-policy create arguments.
- In the end-to-end native fixture test, Codex is given an explicit path, because this sandbox has `/.dockerenv` and so counts as containerized. Codex's default-path resolution is covered by the pure-function tests instead.
- I checked that the post-policy test catches a regression: disabling the URL/header/JSON extraction makes it fail on the proxy canary.
There's no visual change, so no preview.
|
Blocking compatibility correction before review:
Please preserve existing segments and make the manifest truthful across restart/upgrade. Persist the redaction version per segment (treat existing rows as v1), never extend a segment whose stored redaction version differs from the current adapter, and export each segment using its stored version. Add a restart regression with pre-upgrade open and sealed/unacknowledged v1 segments followed by v2 records, proving the v1 segment remains unchanged/reported as v1 and the new segment is v2. Update the operations example that still shows redactionVersion 1 where appropriate. Keep the fail-closed policy migration and unacknowledged-export preservation guarantees intact. |
|
✅ Applied the requested follow-up changes in commit b316c59 Summary of ChangesEach spool segment now records the redaction version that produced it. Rows from before the upgrade count as v1, and both export and status report the stored version instead of always saying 2. All 51 tests in the three managed-diagnostics test files pass, and typecheck and lint are clean. Changes in
Restart regression test (in
Docs ( To stay under the 400-line lint limit, I folded the existing There are no visual previews because nothing here is visible in the UI. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…roduced it. Rows from before the upgrade count as v1, and both export and status report the stored version instead of always saying 2. All 51 tests in the three managed-diagnostics test files pass, and typecheck and lint are clean. Each spool segment now records the redaction version that produced it. Rows from before the upgrade count as v1, and both export and status report the stored version instead of always saying 2. All 51 tests in the three managed-diagnostics test files pass, and typecheck and lint are clean. **Changes in `packages/core/src/diagnostics/managedLogSpool.ts`:** - **Schema:** on startup, a `redaction INTEGER NOT NULL DEFAULT 1` column is added to `segments` if it's missing, so existing rows become v1. New segments are inserted with the current `REDACTION_VERSION`. - **No mixed segments:** `appendRecords()` won't extend the latest segment if its stored version differs from the current one. The new records start a new segment instead, and the usual rotation seals the old v1 segment without touching its contents. - **Export:** `exportOne()` now sets the manifest's `redactionVersion` from the segment's stored value. - **Status:** `redactionVersion` still shows the current adapter (2). A new field, `segmentRedactionVersions`, lists the distinct versions held in the spool, so preserved v1 segments are visible there. - The fail-closed policy migration and the rule that unacknowledged segments are kept are unchanged; the existing policy-upgrade test still passes. **Restart regression test** (in `packages/core/test/managedDiagnosticsPortability.test.ts`): - It builds a pre-upgrade spool and then drops the `redaction` column with raw SQLite, so the database looks like the old schema. - That spool holds one sealed but unacknowledged segment and two open segments (one each on stdout and stderr), all marked v1. - It reopens the spool, adds a record, restarts, and adds another record on the other source. - It checks that the three v1 segments export as `redactionVersion: 1` with the same segment ids, digests and gzip bytes as before. The open ones were not extended, and the sealed one matches its earlier pending export. - The new records land in separate segments exported as `redactionVersion: 2`, and status shows `segmentRedactionVersions: [1, 2]`. - With the fix temporarily reverted, the test fails. **Docs (`docs/operations/managed-diagnostics.md`):** the export example now shows `"redactionVersion": 2`. The status description mentions `segmentRedactionVersions`, and a new paragraph explains that `redactionVersion` is recorded per segment and that pre-upgrade segments are kept, never extended, and exported with their original version. To stay under the 400-line lint limit, I folded the existing `ALTER TABLE` column checks into one loop that now handles both tables. That only changes layout. There are no visual previews because nothing here is visible in the UI. PR: #3031 Comment by: @integry (ID: 6132969486) Model: Claude Opus 5.5
|
/review claude-fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
|
CI failed: CodeQL Please investigate and fix this CI failure.
Failure evidence
|
🔍 AI Code Review — claude-fableOverall EvaluationThis PR closes the four fail-closed diagnostics capture gaps from issue #3023 (provider credential-root resolution across install shapes, final unterminated stdout/stderr lines, a bounded Docker-error/stack-trace continuation adapter, and post-policy injected environment credential discovery), and additionally resolves the blocking compatibility comment by persisting a per-segment redaction version. The approach is well-factored: path resolution is extracted into a database-free module ( ✅ Per-segment redaction version is truthful across upgrade — ✅ Continuation adapter is narrowly scoped and fail-closed — ✅ Policy-injected environment secrets reach redaction — I traced the changed control paths (runtime capture, spool append/seal/export, admission launch plumbing, root resolution for all five providers including managed/Compose/native shapes) and found no demonstrable merge blocker. One material limitation: the Claude launcher's mount computation and The PR is ready to merge within scope, conditional on the currently pending CI checks completing successfully. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Verify Claude Compose mapping removal against the Claude launcherThe removed S2: 🟢 OpenCode refusal does not mirror the launcher's full precedence
S3: 🟢 Clarify error-head acceptance for native files
S4: 🟢 Daemon codex resolution bypasses the codex-specific resolver
ScoreComprehensive, well-tested closure of all issue #3023 gaps plus the blocking segment-versioning correction, with no verified regression in the changed behavior; merge readiness is conditional only on the pending CI checks and one unverifiable Claude-launcher consistency question noted as a follow-up. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 83d7d51 Processed 3 comments:
Summary of ChangesI fixed both CodeQL "polynomial regular expression" alerts by replacing the two flagged regexes with plain linear scans. Matching behaviour is the same as before.
The three managed-diagnostics test files pass: 31, 7 and 13 tests, 51 in total. That includes the existing checks that a proxy URL's userinfo and a stack-trace URL's credentials get redacted. Typecheck and lint are clean. To run these tests, start them from the repo root. From There's no visual change, so I made no preview. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…by replacing the two flagged regexes with plain linear scans. Matching behaviour is the same as before. I fixed both CodeQL "polynomial regular expression" alerts by replacing the two flagged regexes with plain linear scans. Matching behaviour is the same as before. - **`packages/core/src/diagnostics/managedLogRuntime.ts`** (alert #198): the `scheme://user[:password]@` pattern got slow on long runs of characters that look like a URL scheme, because it retried from every starting position. A new helper, `urlUserinfo()`, now finds each `://` with `indexOf`, checks that the scheme before it contains a letter, and reads the user and password forward until whitespace, `/`, `@` (or `:` for the user). It still rejects an empty password and still requires a closing `@`. `secretShapedValues()` collects the same values as before: user, password and `user:password`. - **`packages/core/src/diagnostics/providerRoots.ts`** (alert #199): `.replace(/\/+$/, '')` on the resolved OpenCode config path is now a small `trimTrailingSlashes()` loop. A path with 200,000 slashes now takes about 1 ms. The three managed-diagnostics test files pass: 31, 7 and 13 tests, 51 in total. That includes the existing checks that a proxy URL's userinfo and a stack-trace URL's credentials get redacted. Typecheck and lint are clean. To run these tests, start them from the repo root. From `packages/core`, 10 tests fail because they can't find their modules. There's no visual change, so I made no preview. PR: #3031 Comment by: @github-advanced-security[bot] (ID: 4252589695) Comment by: @github-advanced-security[bot] (ID: 4252589711) Comment by: @propr-dev[bot] (ID: 6133159939) Model: Claude Opus 5.5
|
/fix S2 S3 S4 |
|
✅ Applied the requested follow-up changes in commit 28b5c80
Summary of ChangesI've made all three changes (S2, S3, S4). The 109 tests in the affected suites pass: diagnostics, daemon, OpenCode agent and network egress. Typecheck is clean for the root and S2: OpenCode refusal now matches the launcher
S3: native-file error heads (doc fix only) S4: daemon uses the capture-time resolver Found separately (not changed): OpenCode's There's nothing visual in these changes, so I didn't make previews. Separately, the Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. Nothing in this task needed them. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…the affected suites pass: diagnostics, daemon, OpenCode agent and network egress. Typecheck is clean for the root and `packages/core`, and lint shows no errors on the changed source. The new S2 and S4 tests fail when run against the previous code, so they do catch the old behaviour.
I've made all three changes (S2, S3, S4). The 109 tests in the affected suites pass: diagnostics, daemon, OpenCode agent and network egress. Typecheck is clean for the root and `packages/core`, and lint shows no errors on the changed source. The new S2 and S4 tests fail when run against the previous code, so they do catch the old behaviour.
**S2: OpenCode refusal now matches the launcher**
- **What I found:** the launcher treats `XDG_DATA_HOME` as a reserved name and never forwards it. So it never skips the data mount: it always mounts the inferred `.local/share/opencode` folder. Diagnostics, by contrast, refused capture whenever that variable was set at all, so every such refusal was unnecessary.
- **Shared rule:** I moved the env-var forwarding rule into a new standalone file, `packages/core/src/agents/impl/openCodeEnvForwarding.ts`. `shouldForwardEnvVar` in `openCodeUtils.ts` now uses it and logs the same warnings as before. `resolveProviderCredentialRoot` now refuses only when that rule would actually forward the variable. Both sides now follow one rule, so they stay in step if the reserved list ever changes.
- **The other two launcher conditions:**
- The launcher only mounts the inferred folder if it exists. When it doesn't, capture already refuses with `credential-root:missing`.
- The explicit `dataPath` used by OpenCode analysis is always the same inferred folder, so I didn't need to pass it through.
- **Tests:** one checks the resolver with and without the variable. The other, in `test/opencodeAgent.test.ts`, checks that the launcher's actual mount matches the root diagnostics resolve. I updated the doc's description of the refusal.
**S3: native-file error heads (doc fix only)**
I left the code alone and corrected the doc sentence instead. Native text files recognise the same head lines as stdout/stderr, including Docker errors and exception headers, and export them as single-line `{"message": …}` records with the same redaction. They never carry continuation lines, so stack frames in native files are still dropped and recorded as gaps. I added tests for native exception and Docker-daemon head lines, including redaction of a credential inside them.
**S4: daemon uses the capture-time resolver**
`src/daemon/managedDiagnostics.ts` no longer passes `resolveConfigPath` as an override, so Codex agents go through the Codex-specific resolver, as they do at capture. The new test in `test/daemon.test.ts` uses a containerized install with a Codex agent set to `~/codex-b`, a folder that exists under HOME. That agent is now recorded as `unmapped-native-state` instead of being inventoried at HOME. I also removed the unused `resolveConfigPath` mock from the existing daemon test.
**Found separately (not changed):** OpenCode's `resolveAnalysisDataPath` (`OpenCodeAgent.ts`) has the same "any `XDG_DATA_HOME` set" check. It's harmless because the launcher falls back to the same inferred folder anyway. It isn't part of this PR's changes, so I left it.
There's nothing visual in these changes, so I didn't make previews.
Separately, the Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. Nothing in this task needed them.
PR: #3031
Comment by: @integry (ID: 6133494774)
Model: Claude Opus 5.5
|
/review claude-fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — claude-fableOverall EvaluationThis PR closes the four fail-closed diagnostics capture gaps from #3023: a shared, database-free credential-root resolver ( ✅ Per-segment redaction versioning done correctly — ✅ Post-policy secret discovery is thorough and ReDoS-aware — ✅ Continuation adapter stays fail-closed — The PR needs one correction: the new resolver drops the Compose/hosted Claude env mapping that the previous capture path honored. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Claude Compose capture regresses — CLAUDE_CONFIG_PATH/HOST_CLAUDE_DIR no longer consulted
SuggestionsThese are optional follow-ups and are not sent to S5: 🟢 Continuation window survives a rejected head recordIn S6: 🟢
|
|
/fix F1 S5 S6 |
|
✅ Applied the requested follow-up changes in commit c58e13f
Summary of ChangesI've made all three changes (F1, S5, S6). The new regressions pass, and all four tests that cover them fail when run against the previous source. F1: Claude Compose root
S5: frames after a rejected head
S6:
Verification: the diagnostics, coverage, portability, network-egress, daemon and OpenCode agent suites all pass when run on their own (31, 10, 6, 13, 17, 10 and 41 tests). Running all seven in parallel through Found separately (not changed): the current Claude launcher ( No visual previews, since nothing here changes what a user sees. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ns pass, and all four tests that cover them fail when run against the previous source. I've made all three changes (F1, S5, S6). The new regressions pass, and all four tests that cover them fail when run against the previous source. **F1: Claude Compose root** - `packages/core/src/diagnostics/providerRoots.ts` now has its own Claude case. When an agent uses the default `~/.claude` (including no config path, or a trailing slash), it uses `CLAUDE_CONFIG_PATH`, then `HOST_CLAUDE_DIR`, before falling back to `HOME`. The value still has to be an absolute path, or it is refused as `relative-root`. - Managed, custom `~/…` and absolute Claude paths keep their own meaning and are not replaced by the shared variable. This is the same rule Codex uses. - The daemon inventory (`src/daemon/managedDiagnostics.ts`) goes through the same resolver, so it is fixed too without any change of its own. - New tests: - The resolver test from the review: `HOME=/root`, containerized, `CLAUDE_CONFIG_PATH` set, default `~/.claude` resolves to the mounted directory. It also covers the `HOST_CLAUDE_DIR` fallback, managed/custom/absolute paths, and a relative mapping being refused. - A Compose-style end-to-end check: the worker `HOME` has no `.claude`, only `CLAUDE_CONFIG_PATH` points to a real directory. Capture succeeds, the stored credential is redacted from output, and `providerCredentialRoot` returns the mounted directory. - I updated the Claude row in the doc table in `docs/operations/managed-diagnostics.md`. **S5: frames after a rejected head** - In `captureProviderOutput`, a line that would open a stack-trace window is now checked first with `redactRecord` and the same size limit the spool uses. If that check would reject it, no window opens, so the frames after it are dropped as gaps instead of being exported without their head. This works whether the frames arrive in the same write or a later one. - The capture test now covers both cases (control-character heads), and I added one sentence about this to the doc's Continuations paragraph. **S6: `user:@host`** - `urlUserinfo` no longer skips `user` when the password is empty. - The post-policy env test now includes `-e UPSTREAM=http://opaque-userinfo-canary:@proxy:8080`, and checks the username doesn't appear in the export. **Verification:** the diagnostics, coverage, portability, network-egress, daemon and OpenCode agent suites all pass when run on their own (31, 10, 6, 13, 17, 10 and 41 tests). Running all seven in parallel through `scripts/run-test-suite.mjs`, one test failed: "concurrent process rotation, export and cursor CAS…" in `managedDiagnostics.test.ts`. That file passes 31/31 on its own, so it looks like load from the parallel run rather than these changes. Typecheck is clean for the root and `packages/core`. ESLint finds no errors in the two changed source files; it skips the test file because no ESLint config covers it. **Found separately (not changed):** the current Claude launcher (`dockerArgsBuilder.ts:218`) mounts `resolveConfigPath(config.configPath)`, and for `~/.claude` that does not check `CLAUDE_CONFIG_PATH`. Only the older `claudeService` path and `agentLoginDocker` use that variable. So in Compose the diagnostics root now follows the documented mapping, but the launcher's own mount for a default-path agent may still expand against the worker's `HOME`. That problem was already there before this PR and needs a separate decision. No visual previews, since nothing here changes what a user sees. PR: #3031 Comment by: @integry (ID: 6133743024) Model: Claude Opus 5.5
|
/review claude-fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
The exact head
Please refactor this resolver into small provider-specific helpers (or an equivalent behavior-preserving structure) so the existing complexity rule passes without disabling or suppressing it. Preserve all current fail-closed path validation and the Claude Compose mapping fixed in F1, and retain or extend focused tests as needed. Run the affected lint and diagnostics tests. |
🔍 AI Code Review — claude-fableOverall EvaluationThis PR closes the four fail-closed managed-diagnostics capture gaps from #3023: a shared, dependency-free credential-path resolver ( ✅ Per-segment redaction versioning done correctly — ✅ Backtracking-safe scanners for untrusted input — ✅ Continuation adapter is fail-closed and well tested — I found no merge-blocking defect in the changed code. Merge readiness is conditional on the 10 currently pending checks (including CodeQL and the four test shards) completing green. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S11: 🟢 Align the rejected-head pre-check with the spool's size formulaIn S12: 🟢 Indented JSON inside a continuation window skips the continuation shape checkIn S13: 🟢 Heads are redacted twiceThe capture pre-check in S14: 🟢 Older binaries can still extend v2 segmentsThe per-segment version fix protects upgrades, but a downgrade (an older binary without the S15: 🟢
|
|
✅ Applied the requested follow-up changes in commit 4a5946a Processed 3 comments:
Summary of ChangesI split What changed (all in
Verification:
There's nothing visual to preview. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…-specific helpers, without disabling or suppressing the rule. It now passes the core lint that failed CI, at zero warnings. I split `resolveProviderCredentialRoot` into small provider-specific helpers, without disabling or suppressing the rule. It now passes the core lint that failed CI, at zero warnings. **What changed** (all in `packages/core/src/diagnostics/providerRoots.ts`): - `resolveProviderCredentialRoot` now only does the dispatch: - it checks whether the launcher supplied a mount source. - it refuses unknown providers. - it builds a small `RootContext` (env, config path, path resolver). - it calls the matching provider resolver inside the same `try`/`catch`, so any resolver that throws still returns `unmapped-default-root`. - New helpers: - `launchRoot`: the authoritative `authenticationRoot` / Vibe `nativeRoot` paths. - `defaultResolver`: the Codex path resolver vs the general one. - A `configuredRootResolvers` lookup table for antigravity, claude, vibe and opencode, with `defaultConfiguredRoot` for codex. - `claudeRoot`: the F1 Compose mapping, unchanged. With the default `~/.claude` config, `CLAUDE_CONFIG_PATH` or `HOST_CLAUDE_DIR` is used and the worker's own HOME is never expanded. - `openCodeRoot`: the `HOST_OPENCODE_DATA_DIR`, `XDG_DATA_HOME` and data-directory-next-to-config rules, unchanged. - Each helper's logic is moved over as it was. Every result still goes through `absolute()`, so the relative-path, null-byte and filesystem-root refusals still apply. **Verification:** - **Lint:** I ran `eslint --max-warnings 0` on every `packages/core/src` file this branch adds or modifies, which is what CI runs, and it is clean. A whole-package `npm run lint` still shows two warnings, in `dockerResultProcessor.ts` and `usageTrackingWrapper.ts`. This branch doesn't touch those files and CI doesn't lint them. - **Typecheck:** `tsc --noEmit` is clean for `packages/core` and for the root. - **Diagnostics tests:** the three `managedDiagnostics*` suites pass, 54 tests in total. `managedDiagnosticsCoverage.test.ts` already covers the Claude Compose mapping and every refusal reason (`relative-root`, `unmapped-default-root`, `no-mounted-auth-store`, `unsupported-provider`), so I didn't add tests. - **Other suites using the resolver:** `test/daemon.test.ts` and `test/opencodeAgent.test.ts` pass under the project's suite runner (`scripts/run-test-suite.mjs`) after a core rebuild, with `PROPR_DEMO_MODE=true`. Without that setting, `daemon.test.ts` fails because GitHub auth isn't configured in this environment. There's nothing visual to preview. PR: #3031 Comment by: @propr-dev[bot] (ID: 6133963582) Comment by: @github-actions[bot] (ID: 6133964246) Comment by: @integry (ID: 6133997253) Model: Claude Opus 5.5
|
/review claude-fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — claude-fableOverall EvaluationThis PR closes the four fail-closed managed-diagnostics capture gaps from #3023: it extracts the launcher path resolvers into a dependency-free module ( ✅ Per-segment redaction versioning done correctly — ✅ Orphan-frame invariant is defended, not assumed — ✅ Launcher parity by construction — the daemon inventory and capture now call the same I traced the changed control paths (capture refusals, continuation window lifecycle across writes/close/error, spool batch bounds vs. capture flush bounds, admission/non-admission Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S16: 🟢 Compose OpenCode default ignores OPENCODE_CONFIG_PATH
S17: 🟢 Asymmetric env-mapping semantics between Claude and Antigravity
S18: 🟢 Head lines are redacted twice
S19: 🟢 Duplicated credential-name heuristic
S20: 🟢 Full-environment secret scan vs. the 512-credential boundWith ScoreBoth prior blocking issues (segment redaction-version truthfulness and the complexity-rule failure) are resolved in the current diff with focused regression tests, the four objective gaps are implemented with fail-closed semantics and strong coverage, and no PR-introduced defect could be demonstrated; readiness is conditional only on the in-flight CI checks. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
I fixed F2 and added regression tests for both findings. I did not change the F1 production code, because the failure it describes can't happen in the current code.
**F2 (fixed)** — `scripts/opencode-entrypoint.sh`: the JSONC cleanup now runs in two passes, both of which skip over string contents. Comments are removed first and trailing commas second. Before, comments and commas were handled in a single pass, so a comma followed by a comment and then `}` or `]` was kept. Block comments are replaced with a space so the tokens on either side don't join. The new entrypoint test covers:
- `{"model":"acme/m", /* explanation */ }`
- a trailing comma before a `//` line comment in an array
- several comments after a trailing comma
- a string value containing `, }`, `//` and `/* */`, which must come through unchanged
The new test fails against the old entrypoint and passes with the fix.
**F1 (stated failure doesn't occur; regression added)** — The review's trace assumes an agent's own `OPENCODE_CONFIG_CONTENT` reaches the Docker arguments through `...envVars`. It doesn't. `openCodeEnvForwarding.ts` lists `OPENCODE_CONFIG_CONTENT` as a ProPR-managed variable, so `buildEnvVars` drops it with the warning "Skipping OpenCode env var managed by ProPR". That rule is unchanged from `main` (it came in with #3031). So there is never an earlier assignment for the run's config to override, and passing `undefined` on the normal-task path is correct. The only existing inline config a run can have is the scout config, and the scout path already merges into it and emits it once.
Making the agent's value merge into the launch would mean reversing that #3031 hardening decision, which is a policy change beyond this finding. I added a Docker-argument test instead. It sets an inline provider in the agent's `envVars` and checks two runs, one with extension servers in exclusive mode and one with only the ProPR server. In both there is exactly one `OPENCODE_CONFIG_CONTENT` assignment and it is the run's config. With no tool policy there is none.
**Other notes:**
- A provider set through `OPENCODE_CONFIG_CONTENT` in the agent's variables has always been dropped, with or without this PR. Inline provider settings only work through the mounted config directory, which the exclusive-mode entrypoint keeps. If merging the agent's own inline config is wanted, it needs a separate decision about that hardening rule.
- I ran `git stash` by mistake while checking lint. It failed because the git directory is read-only, so nothing changed, and both edited files are intact.
**Verification:** `test/openCodeExtensionRuntime.test.ts` passes, 20 of 20. The live OpenCode case is skipped because it needs `PROPR_OPENCODE_BIN`. `bash -n` finds no syntax errors in the entrypoint. ESLint has no config that covers `test/`, so the test file isn't linted.
PR: #3861
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
ProPR-Agent: claude/claude-opus-5-5
…rs, skills, ProPR MCP) (#3861) * chore: pass extension MCP servers and skills to OpenCode 2.x runs OpenCode 2.x runs now receive extension MCP servers, skill bundles and the `propr` MCP server, and OpenCode 1.x stays unsupported. I checked this against a real OpenCode 2.4.2 install with a mock model: - The run sees only its own servers and skill. - A stdio stub through the bridge receives its secret. - The gateway gets the bearer token. - `execute` steps display under the tool names they called. The base branch didn't have #3820. The epic branch was cut before OpenCode 2.4.2 landed on `main`, so I applied #3820's own diff unchanged (it applied cleanly). Those identical lines should merge cleanly when the epic picks up `main`, but the diff includes #3820's 26 files, not just this issue's. How it works - Config: the builder is in `packages/core/src/agents/mcpLaunch/openCodeMcpLaunch.ts`, registered as `opencode`. It writes `mcp.servers` and `skills.paths` into `OPENCODE_CONFIG_CONTENT`, merged with any existing inline config, in the shape from the issue. - Secrets: remote servers use `Bearer {env:VAR}`. Tokens and stdio secrets reach the container as `-e NAME` only; their values are never in arguments or config. - Launch: `OpenCodeAgent.executeTask` sets `extensionAgentLaunch` and passes the variables through the docker process environment. The container now joins the policy's Docker network, so `propr` at `api:4000` is reachable. - Exclusive mode: an inline empty `mcp.servers` does not remove host servers on 2.4.2, because OpenCode deep-merges its config sources. So I used the disposable config dir: - The launcher sets `OPENCODE_CONFIG_PROJECT_DISABLE=1`, `OPENCODE_DISABLE_CLAUDE_CODE=1` and an empty `OPENCODE_CONFIG`. - `scripts/opencode-entrypoint.sh` builds a copy of the host config dir with `mcp` and `skills` stripped and the `skills/` folders left out. Everything else links back to the host dir, so the user's providers still work. - The mounted host dir is never changed, and the run fails if a config file can't be rewritten. - Skills: OpenCode loads the staged bundles natively and uses the bundle folder name as the skill id. The prompt pointer is still added. - Display: an `execute` step that called tools now shows under their names (e.g. `docs.lookup`) with the call's input, in both the live view and persisted logs. A script that called no tool stays an `execute` step. - Capability map: OpenCode is turned on with the existing 2.x-only condition. Beyond the issue text - An agent pinned to 1.x now fails a run that has servers or skills with a clear error instead of silently ignoring them. - The automation save checks and the UI now take the agent's CLI version into account. To do that, the instance catalog gained an optional `cliVersion` field. - Updated the UI hints, docs, CHANGELOG and the OpenAPI description, and regenerated the OpenAPI spec and client types. - Tests that used OpenCode as the "unsupported runtime" example now use OpenCode pinned to 1.19.6. One gap: OpenCode always loads `~/.agents/skills` from the container home, and no setting turns that off. The agent image doesn't create that folder, so nothing loads from it today. Tests: all pass. - The new `test/openCodeExtensionRuntime.test.ts` covers: - a config snapshot for each server kind, with no secrets in arguments, config or serialized results - the exclusive switches overriding the user's own env vars, and the 1.x refusal - the entrypoint step, including the failing case - the bridge smoke test - both parsers, using a captured real 2.4.2 output fixture - Its live end-to-end case only runs when `PROPR_OPENCODE_BIN` is set. It passed against 2.4.2, with host, project and `~/.claude` servers and skills all excluded. - I added OpenCode cases to `extensionTaskAutoApply` and `extensionPackageServers`. - The related root, core, API and UI suites pass. - ESLint is clean with zero warnings, and the core, API, shared and UI typechecks are clean. - Some root suites need `--experimental-test-module-mocks` to run locally. I captured two previews of the automation editor with an OpenCode 1.x agent selected: the new Additional extensions hint, and the locked ProPR tools hint. ProPR-Agent: claude/claude-opus-5-5 * test: pin OpenCode 1.x in extension runtime skip test I fixed the Shard 3/4 failure. It was one stale test, not a code bug. **Cause:** in `packages/shared/test/extensionLibrary.test.ts`, the case "explicit entries that are missing, disabled or out of limits are skipped with a reason" uses OpenCode with no version as its example of a runtime that can't receive extensions. Its last assertion expected the `docs` server to be skipped with reason `runtime`. This PR turns extensions on for OpenCode 2.x, and a runtime with no version gets the mapped capabilities. So `docs` now applies, `skipped` is empty, and `skipped[0].reason` threw `Cannot read properties of undefined (reading 'reason')`. **Fix:** that assertion now passes `cliVersion: '1.19.6'`, the same OpenCode 1.x pin this PR already uses in the other "unsupported runtime" tests. It's a one-line change, and it still checks the skip with reason `runtime`. **Verification:** that file now passes 11/11, and all of `packages/shared/test/*.test.ts` passes (136 pass, 0 fail). This was the only failing test in the shard; the other 281 files passed. There are no visual changes, so I made no preview. PR: #3861 Comment by: @propr-dev[bot] (ID: 7229795304) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5 * chore: strip JSONC trailing commas after comments in entrypoint I fixed F2 and added regression tests for both findings. I did not change the F1 production code, because the failure it describes can't happen in the current code. **F2 (fixed)** — `scripts/opencode-entrypoint.sh`: the JSONC cleanup now runs in two passes, both of which skip over string contents. Comments are removed first and trailing commas second. Before, comments and commas were handled in a single pass, so a comma followed by a comment and then `}` or `]` was kept. Block comments are replaced with a space so the tokens on either side don't join. The new entrypoint test covers: - `{"model":"acme/m", /* explanation */ }` - a trailing comma before a `//` line comment in an array - several comments after a trailing comma - a string value containing `, }`, `//` and `/* */`, which must come through unchanged The new test fails against the old entrypoint and passes with the fix. **F1 (stated failure doesn't occur; regression added)** — The review's trace assumes an agent's own `OPENCODE_CONFIG_CONTENT` reaches the Docker arguments through `...envVars`. It doesn't. `openCodeEnvForwarding.ts` lists `OPENCODE_CONFIG_CONTENT` as a ProPR-managed variable, so `buildEnvVars` drops it with the warning "Skipping OpenCode env var managed by ProPR". That rule is unchanged from `main` (it came in with #3031). So there is never an earlier assignment for the run's config to override, and passing `undefined` on the normal-task path is correct. The only existing inline config a run can have is the scout config, and the scout path already merges into it and emits it once. Making the agent's value merge into the launch would mean reversing that #3031 hardening decision, which is a policy change beyond this finding. I added a Docker-argument test instead. It sets an inline provider in the agent's `envVars` and checks two runs, one with extension servers in exclusive mode and one with only the ProPR server. In both there is exactly one `OPENCODE_CONFIG_CONTENT` assignment and it is the run's config. With no tool policy there is none. **Other notes:** - A provider set through `OPENCODE_CONFIG_CONTENT` in the agent's variables has always been dropped, with or without this PR. Inline provider settings only work through the mounted config directory, which the exclusive-mode entrypoint keeps. If merging the agent's own inline config is wanted, it needs a separate decision about that hardening rule. - I ran `git stash` by mistake while checking lint. It failed because the git directory is read-only, so nothing changed, and both edited files are intact. **Verification:** `test/openCodeExtensionRuntime.test.ts` passes, 20 of 20. The live OpenCode case is skipped because it needs `PROPR_OPENCODE_BIN`. `bash -n` finds no syntax errors in the entrypoint. ESLint has no config that covers `test/`, so the test file isn't linted. PR: #3861 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5 ProPR-Agent: claude/claude-opus-5-5 --------- Co-authored-by: propr-dev[bot] <1316198+propr-dev[bot]@users.noreply.github.com>
AI Implementation Summary
Closes #3023
Branch:
3023/claude-opus-5-5-close-fail-closed-managed-20261012-2113-ulyCommits: ✅ Changes committed (7130453)
AI Processing Completed
Execution Details:
Summary:
I've closed all four gaps from #3023. The 238 tests across the diagnostics, launch, admission, network-egress, config and daemon suites pass, including 7 new ones in
packages/core/test/managedDiagnosticsCoverage.test.ts. Typecheck and lint are clean on the changed source.1. Provider credential roots
resolveConfigPathand the Codex variant) into a new database-free module,packages/core/src/config/agentConfigPaths.ts.configManagerAgents.tsre-exports it unchanged. Diagnostics can now use the launchers' own path rules without loading SQLite.diagnostics/providerRoots.tsreturns either the root or an explicit refusal, using the same rules the launchers mount from:CODEX_CONFIG_PATH, thenHOST_CODEX_DIR, else~/.codex.VIBE_CONFIG_PATH.~/.propr/agent-credentials.HOST_*variables are no longer required when the launch path itself resolves.capturesource ascredential-root:<reason>:unmapped-default-root,relative-root,no-mounted-auth-store,unsupported-providerormissing.2. Unterminated final line: a final line without a newline is now captured as a record when the stream closes, instead of always becoming a gap. Only an oversized tail is still a gap.
3. Docker errors and stack traces
TypeError: …,Traceback …,panic: …) are now accepted on stdout/stderr.at …, PythonFile "…", line N, Go frames,Caused by:). They export as{"continuation": …}and get the same redaction.{/}or ending in a credential assignment is rejected, and any other line ends the window. Native log files keep the stricter single-line rules.4. Environment injected by the network/admission policy: native goal launches (Codex app-server, Claude, Antigravity) were scanning the pre-policy arguments plus the admission
docker startcommand. That meant environment variables added by the network rewrite were never checked for secrets.spawnAdmittedAgentandspawnWithNetworkPolicynow hand the callback the post-policy create arguments and launch environment as a second argument. The final and create arguments are still scanned separately. The scan now handles:--env=K=V,-eK=V, and-e K(value taken from the launch environment).GIT_CONFIG_VALUE_*values.Bearer/Basicheader values.Docs:
docs/operations/managed-diagnostics.mdhas a new "Provider stream capture coverage" section. It covers the root table, the refusal reasons and record outcomes, and the capture shapes I intentionally left unsupported:code: '…'property dumps--env-filecontentsThings to check in review:
managedDiagnostics.test.tsnow setsHOMEto a temp directory, because with the new resolver a real~/.codexon the test machine could have made it capture.networkEgressPolicyCoverage.test.tsnow asserts the callback receives the post-policy create arguments./.dockerenvand so counts as containerized. Codex's default-path resolution is covered by the pure-function tests instead.There's no visual change, so no preview.
Detailed Logs:
14e5aa23-5a39-43d3-94fa-8afe17a97420Log files stored at:
/tmp/claude-logs/issue-3023-2026-10-12T21-27-44-069Z-conversation.json/tmp/claude-logs/issue-3023-2026-10-12T21-27-44-069Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3023.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!