Title: fix(provenance): report why a projection was refused, at the point of refusal by waleedlatif1 · Pull Request #6483 · simstudioai/sim · GitHub
Open Graph Title: fix(provenance): report why a projection was refused, at the point of refusal by waleedlatif1 · Pull Request #6483 · simstudioai/sim
X Title: fix(provenance): report why a projection was refused, at the point of refusal by waleedlatif1 · Pull Request #6483 · simstudioai/sim
Description: Why A resolved-secret projection that fails closed reaches the user as one fixed sentence (… could not be safely projected). The guard that caused it may have tripped many frames — or a whole process — earlier, and the incompleteness latch is one-way, so by the time a run refuses, the causing call has long since returned. #6478 recorded the reason when the guard tripped. But markIncomplete early-returns once a registry is already incomplete, so a run that inherits an incomplete registry refuses with nothing recorded anywhere. That is the case production actually hits: in the hours after #6478 deployed, every observed incompleteness was source-provenance-incomplete or inherited-incomplete-source, and projection-mismatch fired zero times. What this changes Nothing behavioural. Two pieces: 1. The registry retains its reasons. Previously the reason was handed to the logger and dropped. It is now kept in an insertion-ordered set with a getIncompletenessDiagnostics() accessor that returns undefined while the registry can still vouch, so a caller cannot report a cause for a projection that succeeded. Two placement decisions carry the weight: Recorded before the already-incomplete early return, so a causal chain accumulates rather than only the first reason. Recorded before the silence checks, so constructed-incomplete — which deliberately logs nothing when marked, because it sits on the per-webhook hot path — is still nameable at refusal. That was the blind spot #6478 introduced. Propagation is folded into the latch: markIncomplete(reason, source?) inherits the source's reasons, and copyIncompleteInputPathsTo carries reasons with the paths (a target becomes permanently incomplete through the copy alone, with no mark call to attach a cause to). A future fork/merge path therefore cannot latch without its cause. 2. One choke point for refusal. refuseResolvedSecretProjection() logs boundary, cause, input path and workspace, then throws. All 68 refusal sites across 13 files now route through it. Returns never, so if (!projection.complete) refuse(...) still narrows — each site is a one-line swap, no restructuring. The message is passed by the caller, so user-facing wording is unchanged; per-file constants mean 50 hand-typed copies can no longer drift apart. Custom error types are preserved (AgentToolInputSafetyError ×29, CopilotModelContentProjectionError ×2), so existing catch clauses still match. Deduplicated per registry per (site, inputPath) — an agent projects tool input on every loop iteration, and a latched registry would otherwise emit a line per iteration. A refusal with no registry is never deduplicated: those sites abort the request rather than iterate, so any process-wide memory of them would silence every later request, including the one being investigated. The cause discriminator Two different failure families reach this one event: a registry that latched and genuinely cannot vouch, and a caller-side cross-check finding the projection's own output malformed (!isPlainRecord(projected), arity mismatches). Only the first carries reasons, so a query filtered on reason would silently cover half the population. Each record therefore carries cause: 'registry-latched' | 'projection-cross-check'. Why the instrumentation lives at the throw site {safe: false} is not synonymous with refusal — pi/local/sim-tools.ts and copilot/tools/server/media/ffmpeg.ts both consume the same projection helpers and degrade gracefully. Instrumenting the projection API would log fleet-visible errors for handled outcomes, and would still miss most of these 68 sites, which are not projection-call failures at all but caller-side cross-checks the projection function cannot see. Refusal is a caller-side concept. Deliberately not in this PR The reason still does not cross a process boundary. The serialized envelope carries a bare complete: false, so a consumer can report source-provenance-incomplete but never say why the producer failed. That is a wire-format change with two hard constraints: isResolvedSecretTraceProvenanceV1 validates with an exact-property check, so an added field makes an old consumer reject the envelope outright during a rolling deploy; and envelope size is checked against MAX_SERIALIZED_PROVENANCE_BYTES, so added bytes can push a borderline envelope over and cause new provenance-capacity-exceeded refusals. It needs its own version bump and byte accounting. This PR is still a large win without it: the producer process now logs the real cause locally, so cross-process correlation becomes "join two log lines" instead of correlating CloudWatch against S3 blobs by workspace id. Three sites still pass no registry (copilot.initialAttachments* ×2, mcpServe.executionError) — each would need the registry threaded up several frames. Down from 8; the five responseFormat sites were fixed here. Type of Change Bug fix (diagnosability; no behaviour change) Testing Registry + refusal suites 406 passing, including coverage for: retention before the early return, retention of a silenced by-design origin, inheritance through a fork naming the originating guard, per-registry dedup under a 25-iteration loop, distinct paths reported separately, the latched/cross-check discriminator, and absence of secret material in the record. Each was verified to fail when its specific guard is reverted. Wider run across executor, lib, app, tools, providers: 16,726 passing, 0 test failures. Typecheck, biome, and check:api-validation clean. (140 suites fail to collect in my worktree from a local tailwind v4/v3 artifact — byte-identical list on a clean tree with this change stashed.) Messages verified byte-identical against the base commit per file, with counts. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Why A resolved-secret projection that fails closed reaches the user as one fixed sentence (… could not be safely projected). The guard that caused it may have tripped many frames — or a whole proce...
X Description: Why A resolved-secret projection that fails closed reaches the user as one fixed sentence (… could not be safely projected). The guard that caused it may have tripped many frames — or a whole proce...
Opengraph URL: https://github.com/simstudioai/sim/pull/6483
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:701d22cc-c75e-75ce-278d-71a4471e206a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D460:32D628:8A5026:BE1F5F:6AFB494F |
| html-safe-nonce | e4af79483d01522cf2da97631efce332c0dfdf7cceec085328f1c3e77997621c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDYwOjMyRDYyODo4QTUwMjY6QkUxRjVGOjZBRkI0OTRGIiwidmlzaXRvcl9pZCI6IjYyMzA2NjU1NjI5NjgyNDY2MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 60b92d4bf6aab60b221dcd0a03d1eab665aed6818e0f6d2457165df6c577ed50 |
| hovercard-subject-tag | pull_request:4241344607 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6483/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Why A resolved-secret projection that fails closed reaches the user as one fixed sentence (… could not be safely projected). The guard that caused it may have tripped many frames — or a whole proce... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26504db649b58525278f77a52b80ba5f10d5f4de |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width