Repository navigation
fix(dsh): mirror every canonical credential shape in the observer - #7733
Open
JasonBuildAI wants to merge 1 commit into
Open
JasonBuildAI wants to merge 1 commit into
JasonBuildAI wants to merge 1 commit into
Conversation
JasonBuildAI
requested review from
huangruiteng,
loopx-agent and
songoow
as code owners
October 30, 2026 05:48
The DSH shadow observer is the only writer of `reliability_diagnostics` ledger bytes, and its documented contract is that credential-like tokens fail closed before the first append. It enforced that contract with a hand-written copy of the canonical owner's shapes that carried two of the nine provider-issuer arms and four of the labeled arms, raised the GitHub floor from 16 to 20, and accepted only two directory names under a Windows drive. A 38-value cross-language differential at upstream/main found seventeen values the canonical `loopx/public_safe_text.py` owner refuses and the producer accepted and wrote in cleartext: a GitHub fine-grained PAT and any 16-19 character classic PAT, AWS access and session key ids, Slack bot and app tokens, a Google API key, a Stripe restricted key, npm and PyPI tokens, `api_key:`, `access_token:`, `refresh_token:`, `password:` and `secret:` labels, and any drive path outside `users` / `documents and settings`. Spell every arm byte-identically to the canonical owner and add a parity test that rebuilds the canonical alternation from the mirror's own arms, so an arm added, narrowed or invented on one side fails in the suite that runs on both. No envelope, stats, ledger or activation contract changes. Fixes loopx-project#7729 Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
JasonBuildAI
force-pushed
the
codex/agent-v3r7
branch
from
October 30, 2026 05:54
8633321 to
7c96eea
Compare
JasonBuildAI
added a commit
to JasonBuildAI/loopx
that referenced
this pull request
Oct 30, 2026
…7733 Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal And Delivered Outcome
Impact. Anyone who enables the DSH shadow observer (
packages/dsh-loopx-plugin, the only producer ofreliability_diagnosticsledger bytes) can have a live provider credential written in cleartext into the durable diagnostic ledger. The capability README promises the opposite — "Absolute local paths and credential-like tokens fail closed without reaching ledger bytes" — and the accepted RFC names "producer-side public-safety rejection before the first ledger append" as its P0 checkpoint. The producer implemented that control as a hand copy that had already lost most of the canonical owner's shapes.Beneficiary. Operators running the DSH observer, and anyone they hand a diagnostic ledger or receipt to: the ledger is a whole-file export ("no filtering of negative records") and the read-only projection also surfaces
tool_namefrom the summary.Scale. Seventeen distinct values across four arm classes. A 38-value differential against the canonical
loopx/public_safe_text.pyowner at upstream/main found 17 that the producer accepted and appended while the Python owner refuses them:AKIA/ASIA, Slackxoxb-/xoxp-, GoogleAIza, Striperk_live_, npm, PyPIapi_key:,access_token:,refresh_token:,password:,secret:apiarm of(?:access|api|secret)[_-]?keyusers/documents and settingsOutcome basis / optional anchor: fixes [Bug]: the DSH shadow observer's producer-side public-safety check misses 7 of 9 provider credential shapes and narrows the drive-path arm #7729; the drift class is tracked by open architecture issue [Architecture]: two modules both claim to own "private-looking text" #5136, and [Bug]: the builtin public-safe-outbound scan certifies GitHub, AWS, Slack, Google, npm, PyPI and Stripe credentials as public-safe #7635/fix(capability): detect unlabeled provider tokens in the outbound scan #7636, [Bug]: the public-boundary publication gate in loopx check certifies unlabeled provider credentials as public-safe #7712/fix(contract): catch unlabeled provider tokens in the public boundary scan #7713, [Bug]: Chat activity masker persists npm/PyPI/Google/AWS/Slack/JWT tokens for replay #7717/fix(presentation): mask unlabeled provider tokens in chat activity #7718 already repaired the same class in
public_safe_outbound/scanner.py,contract.pyandpresentation/codex_activity.py.Goal/source and gap: the producer's fail-closed check is a hand-written mirror of the canonical owner, and the mirror carried 2 of 9 provider-issuer arms, 4 of 5 labeled arms, one narrowed label alternative, a GitHub floor of 20 instead of 16, and a drive arm restricted to two directory names. No test could see it:
tests/fixtures/public_safe_text_corpus.jsonpins onlypublic_safe_text.pyagainst the Vision checkpoint mirror, and the DSH shared fixture lists two credential shapes the producer already rejects.Observable before → after, with the validation row that proves it: the same value set, driven through
ShadowObserver.observeSessionEvent→isPublicSafeValue→appendLedgerLines, was accepted and written for 17 values and is rejected withpublic_safety_violationfor all 17 now; the newrefuses every canonical credential arm before the first appendrow asserts it per value.Issue/task and intended base:
Fixes #7729; baseloopx-project/loopxmainat225698b31.Author Declaration
AI disclosure: this change was drafted with AI assistance at my request, under my direction and review.
Implemented against
loopx/capabilities/reliability_diagnostics/README.md("Every provider applies the equivalent recursive public-safe value contract before its first append ... credential-like tokens fail closed without reaching ledger bytes") anddocs/architecture/rfcs/long-running-agent-reliability-diagnostics-governed-delivery-v0.mdP0 checkpoint ("producer-side public-safety rejection before the first ledger append"), both at225698b31; the canonical shape text isloopx/public_safe_text.pySECRET_LIKE_SURFACE_PATTERN/LOCAL_PATH_SURFACE_PATTERNat the same revision.SECRET_LIKE_SURFACES,packages/dsh-loopx-plugin/src/observer.tsobserver.spec.ts→refuses every canonical credential arm before the first appendLOCAL_PATH_SURFACES, same filewindows_drive_outside_user_profilerowtest_typescript_mirror_equals_the_canonical_credential_arms,test_typescript_mirror_equals_the_canonical_local_path_surfacesloopx/cli_commands/reliability_diagnostics.pytests/capabilities/test_reliability_diagnostics.pytests/capabilities/test_reliability_diagnostics_dsh_provider.py(30 passed), full plugin suite parity belowruff check, and a 38-value cross-language differential before/after. Deliberately left out: the POSIX/UNC/home-relative canonical path arms are mirrored for parity but are not reachable through the producer's own compact-token filters; the file-URL arm stays broader than the canonicalfile://because narrowing it would loosen a check that already rejectsfile:/…. Two residual differences are documented rather than fixed: JavaScript's ASCII-only\bmakes the mirror stricter than the Unicode-aware Python boundary for a token glued to a non-ASCII letter, and the parity test compares the arm list in order, so reordering it reads as a failure even though it changes no verdict.Scope And Continuation
Validation
7c96eea8d(rebased onto225698b31)unitpassedtests/capabilities/test_reliability_diagnostics_dsh_provider.py→ 30 passed. With the baseobserver.tsrestored in place, the two new tests fail (2 failed / 28 passed), so they are not vacuous.unitpassedpackages/dsh-loopx-plugin/tests/observer.spec.ts→ 12 passed, 1 failed. The failure isis off unless one exact goal, session, and run identity are declared, a pre-existing Windows-only path-resolution assertion (the fixture's POSIX/tmpledger directory is rewritten drive-qualified on Windows); the same single test fails identically at the base revision (11 passed, 1 failed).unitpassed9 failed / 198 passed (207), head9 failed / 199 passed (208)— the same nine pre-existing Windows-host failures (POSIX fixture paths, child-close timing, symlink/permission), plus the one new passing test. No regression.staticpassedtsc -p tsconfig.host.json --noEmit,tsc -p tsconfig.client.json --noEmit,tsc -p tsconfig.tests.json --noEmit→ exit 0 each.staticpassedruff check tests/capabilities/test_reliability_diagnostics_dsh_provider.py→ All checks passed.regression_paritypassedmanualpassedobserver.tsand pass at head.integrationfailedloopx canary premerge --from-git-diff --git-diff-base upstream/mainselected thedsh-loopx-pluginrisk profile and failed on this Windows host for two reasons that both reproduce at the base revision: thequalityphase runs the same full vitest suite (9 pre-existing Windows-only failures, base9 failed / 198 passed), and thepackage/runtimephases stop atspawnSync ...\node_modules\.bin\dsh ENOENT, which the same smokes hit identically at base. The four direct checks (diff hygiene ×3, RFC bilingual) andpy_compilepassed. Hosteddsh-plugin.ymlruns typecheck and the suite on its own Ubuntu and Windows runners.SUMMARY_TOKEN/IDENTITY_TOKEN), and the exactfile:arm, which stays broader than the canonical form by design.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).