@jinn-network/client 0.1.9-canary.5c19fc6d → 0.1.9-canary.5ff3d8cb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CONTRIBUTING.md +2 -2
  2. package/dist/adapters/mech/adapter.d.ts +10 -0
  3. package/dist/adapters/mech/adapter.js +19 -1
  4. package/dist/adapters/mech/adapter.js.map +1 -1
  5. package/dist/adapters/mech/types.d.ts +1 -88
  6. package/dist/adapters/mech/types.js +1 -45
  7. package/dist/adapters/mech/types.js.map +1 -1
  8. package/dist/api/bootstrap-endpoint.d.ts +18 -3
  9. package/dist/api/bootstrap-endpoint.js +3 -0
  10. package/dist/api/bootstrap-endpoint.js.map +1 -1
  11. package/dist/api/gather-status.js +6 -5
  12. package/dist/api/gather-status.js.map +1 -1
  13. package/dist/api/launcher-endpoints.js +6 -1
  14. package/dist/api/launcher-endpoints.js.map +1 -1
  15. package/dist/api/launcher-status.d.ts +2 -0
  16. package/dist/api/launcher-status.js.map +1 -1
  17. package/dist/api/launcher-tasks.d.ts +47 -0
  18. package/dist/api/launcher-tasks.js +88 -3
  19. package/dist/api/launcher-tasks.js.map +1 -1
  20. package/dist/api/loop-completion-build.d.ts +2 -2
  21. package/dist/api/loop-completion-build.js +2 -3
  22. package/dist/api/loop-completion-build.js.map +1 -1
  23. package/dist/api/portfolio-v0-build.d.ts +2 -1
  24. package/dist/api/portfolio-v0-build.js +5 -7
  25. package/dist/api/portfolio-v0-build.js.map +1 -1
  26. package/dist/api/prediction-v1-build.d.ts +2 -2
  27. package/dist/api/prediction-v1-build.js +5 -7
  28. package/dist/api/prediction-v1-build.js.map +1 -1
  29. package/dist/api/setup-endpoints.d.ts +4 -0
  30. package/dist/api/setup-endpoints.js +13 -7
  31. package/dist/api/setup-endpoints.js.map +1 -1
  32. package/dist/api/status-build.js +1 -4
  33. package/dist/api/status-build.js.map +1 -1
  34. package/dist/api/task-run-routing.d.ts +1 -1
  35. package/dist/api/task-runs-build.d.ts +2 -2
  36. package/dist/api/task-runs-build.js +5 -7
  37. package/dist/api/task-runs-build.js.map +1 -1
  38. package/dist/bin/jinn-distill-mcp.js +813 -0
  39. package/dist/bin/jinn-layer.js +4992 -1151
  40. package/dist/build-info.json +4 -4
  41. package/dist/build-meta.json +1 -1
  42. package/dist/captures/distil-export.d.ts +54 -0
  43. package/dist/captures/distil-export.js +135 -0
  44. package/dist/captures/distil-export.js.map +1 -0
  45. package/dist/captures/ingest.d.ts +21 -0
  46. package/dist/captures/ingest.js +144 -0
  47. package/dist/captures/ingest.js.map +1 -0
  48. package/dist/captures/live-publisher.js +4 -3
  49. package/dist/captures/live-publisher.js.map +1 -1
  50. package/dist/captures/publish.d.ts +4 -0
  51. package/dist/captures/publish.js +2 -2
  52. package/dist/captures/publish.js.map +1 -1
  53. package/dist/cli/execution-context.js +2 -1
  54. package/dist/cli/execution-context.js.map +1 -1
  55. package/dist/config.js +34 -1
  56. package/dist/config.js.map +1 -1
  57. package/dist/contracts/abis.d.ts +100 -0
  58. package/dist/contracts/abis.js +58 -0
  59. package/dist/contracts/abis.js.map +1 -0
  60. package/dist/contracts/addresses.d.ts +36 -0
  61. package/dist/contracts/addresses.js +60 -0
  62. package/dist/contracts/addresses.js.map +1 -0
  63. package/dist/corpus/onchain-query.d.ts +0 -1
  64. package/dist/corpus/onchain-query.js +2 -5
  65. package/dist/corpus/onchain-query.js.map +1 -1
  66. package/dist/daemon/balance-topup-loop.js +27 -12
  67. package/dist/daemon/balance-topup-loop.js.map +1 -1
  68. package/dist/daemon/creator.js +15 -13
  69. package/dist/daemon/creator.js.map +1 -1
  70. package/dist/daemon/daemon.js +35 -13
  71. package/dist/daemon/daemon.js.map +1 -1
  72. package/dist/daemon/loop-heartbeat.d.ts +62 -7
  73. package/dist/daemon/loop-heartbeat.js +50 -13
  74. package/dist/daemon/loop-heartbeat.js.map +1 -1
  75. package/dist/{api/peers.js → daemon/peer-sync.js} +2 -2
  76. package/dist/daemon/peer-sync.js.map +1 -0
  77. package/dist/daemon/reward-claim-loop.js +27 -12
  78. package/dist/daemon/reward-claim-loop.js.map +1 -1
  79. package/dist/daemon/spend-cap-gate.d.ts +0 -6
  80. package/dist/daemon/spend-cap-gate.js +1 -8
  81. package/dist/daemon/spend-cap-gate.js.map +1 -1
  82. package/dist/dashboard/assets/index-BdGCkGPF.js +157 -0
  83. package/dist/dashboard/assets/index-D7rvJRNa.css +1 -0
  84. package/dist/dashboard/index.html +2 -2
  85. package/dist/discovery/http.js +83 -1
  86. package/dist/discovery/http.js.map +1 -1
  87. package/dist/discovery/onchain.js +16 -8
  88. package/dist/discovery/onchain.js.map +1 -1
  89. package/dist/discovery/types.d.ts +43 -0
  90. package/dist/discovery/types.js.map +1 -1
  91. package/dist/discovery/with-fallback.js +10 -0
  92. package/dist/discovery/with-fallback.js.map +1 -1
  93. package/dist/earning/bootstrap-run.d.ts +25 -0
  94. package/dist/earning/bootstrap-run.js +315 -0
  95. package/dist/earning/bootstrap-run.js.map +1 -0
  96. package/dist/earning/bootstrap.d.ts +6 -11
  97. package/dist/earning/bootstrap.js +45 -195
  98. package/dist/earning/bootstrap.js.map +1 -1
  99. package/dist/earning/contracts.d.ts +2 -3
  100. package/dist/earning/contracts.js +12 -21
  101. package/dist/earning/contracts.js.map +1 -1
  102. package/dist/earning/master-gas.d.ts +10 -0
  103. package/dist/earning/master-gas.js +11 -0
  104. package/dist/earning/master-gas.js.map +1 -0
  105. package/dist/earning/safe-adapter.js +1 -45
  106. package/dist/earning/safe-adapter.js.map +1 -1
  107. package/dist/earning/steps/context.d.ts +42 -0
  108. package/dist/earning/steps/context.js +4 -0
  109. package/dist/earning/steps/context.js.map +1 -0
  110. package/dist/earning/steps/fleet-identity-register.d.ts +4 -0
  111. package/dist/earning/steps/fleet-identity-register.js +65 -0
  112. package/dist/earning/steps/fleet-identity-register.js.map +1 -0
  113. package/dist/earning/steps/fleet-safe-deploy.d.ts +4 -0
  114. package/dist/earning/steps/fleet-safe-deploy.js +62 -0
  115. package/dist/earning/steps/fleet-safe-deploy.js.map +1 -0
  116. package/dist/earning/steps/fleet-safe-predict.d.ts +4 -0
  117. package/dist/earning/steps/fleet-safe-predict.js +18 -0
  118. package/dist/earning/steps/fleet-safe-predict.js.map +1 -0
  119. package/dist/earning/steps/receipt-parsing.d.ts +12 -0
  120. package/dist/earning/steps/receipt-parsing.js +71 -0
  121. package/dist/earning/steps/receipt-parsing.js.map +1 -0
  122. package/dist/earning/stolas-staking.js +20 -14
  123. package/dist/earning/stolas-staking.js.map +1 -1
  124. package/dist/erc8004/addresses.d.ts +6 -5
  125. package/dist/erc8004/addresses.js +7 -5
  126. package/dist/erc8004/addresses.js.map +1 -1
  127. package/dist/erc8004/identity.d.ts +12 -1
  128. package/dist/erc8004/identity.js +31 -0
  129. package/dist/erc8004/identity.js.map +1 -1
  130. package/dist/erc8004/index.d.ts +1 -1
  131. package/dist/erc8004/index.js +1 -1
  132. package/dist/erc8004/index.js.map +1 -1
  133. package/dist/erc8004/reputation.js +16 -12
  134. package/dist/erc8004/reputation.js.map +1 -1
  135. package/dist/erc8004/validation.js +5 -4
  136. package/dist/erc8004/validation.js.map +1 -1
  137. package/dist/eval/capability-slate.d.ts +54 -0
  138. package/dist/eval/capability-slate.js +116 -0
  139. package/dist/eval/capability-slate.js.map +1 -0
  140. package/dist/eval/capability-stats.d.ts +39 -0
  141. package/dist/eval/capability-stats.js +123 -0
  142. package/dist/eval/capability-stats.js.map +1 -0
  143. package/dist/eval/contested-band.d.ts +18 -0
  144. package/dist/eval/contested-band.js +19 -0
  145. package/dist/eval/contested-band.js.map +1 -0
  146. package/dist/eval/corpus-index.d.ts +21 -0
  147. package/dist/eval/corpus-index.js +55 -0
  148. package/dist/eval/corpus-index.js.map +1 -0
  149. package/dist/eval/disjointness.d.ts +26 -0
  150. package/dist/eval/disjointness.js +67 -0
  151. package/dist/eval/disjointness.js.map +1 -0
  152. package/dist/eval/mcnemar-power.d.ts +14 -0
  153. package/dist/eval/mcnemar-power.js +40 -0
  154. package/dist/eval/mcnemar-power.js.map +1 -0
  155. package/dist/harnesses/engine/engine.d.ts +2 -1
  156. package/dist/harnesses/engine/engine.js +15 -2
  157. package/dist/harnesses/engine/engine.js.map +1 -1
  158. package/dist/harnesses/engine/persistence.d.ts +2 -61
  159. package/dist/harnesses/engine/persistence.js.map +1 -1
  160. package/dist/harnesses/impls/_evaluator-base.d.ts +48 -0
  161. package/dist/harnesses/impls/_evaluator-base.js +35 -0
  162. package/dist/harnesses/impls/_evaluator-base.js.map +1 -0
  163. package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +2 -3
  164. package/dist/harnesses/impls/claude-mcp-prediction/index.js +29 -99
  165. package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
  166. package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +4 -21
  167. package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -1
  168. package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +2 -0
  169. package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +1 -1
  170. package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
  171. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +30 -79
  172. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
  173. package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +4 -19
  174. package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -1
  175. package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +2 -0
  176. package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +1 -1
  177. package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
  178. package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.d.ts +39 -0
  179. package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js +62 -0
  180. package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js.map +1 -0
  181. package/dist/harnesses/impls/claude-mcp-shared/mcp-server.d.ts +40 -0
  182. package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js +44 -0
  183. package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js.map +1 -0
  184. package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.d.ts +56 -0
  185. package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js +79 -0
  186. package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js.map +1 -0
  187. package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +3 -1
  188. package/dist/harnesses/impls/learner/adapters/codex-code.js +39 -4
  189. package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
  190. package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +5 -15
  191. package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +10 -29
  192. package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
  193. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +5 -15
  194. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +10 -23
  195. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
  196. package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +5 -15
  197. package/dist/harnesses/impls/prediction-v0-evaluator/index.js +10 -25
  198. package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
  199. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +8 -0
  200. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
  201. package/dist/learner/verification-gate.d.ts +53 -0
  202. package/dist/learner/verification-gate.js +80 -0
  203. package/dist/learner/verification-gate.js.map +1 -0
  204. package/dist/main.js +74 -457
  205. package/dist/main.js.map +1 -1
  206. package/dist/monitoring/net-liveness.d.ts +143 -0
  207. package/dist/monitoring/net-liveness.js +301 -0
  208. package/dist/monitoring/net-liveness.js.map +1 -0
  209. package/dist/observability/progress.d.ts +11 -0
  210. package/dist/observability/progress.js +16 -0
  211. package/dist/observability/progress.js.map +1 -0
  212. package/dist/pilot/cost.d.ts +19 -0
  213. package/dist/pilot/cost.js +31 -0
  214. package/dist/pilot/cost.js.map +1 -0
  215. package/dist/pilot/instance.d.ts +20 -0
  216. package/dist/pilot/instance.js +19 -0
  217. package/dist/pilot/instance.js.map +1 -0
  218. package/dist/pilot/repo.d.ts +31 -0
  219. package/dist/pilot/repo.js +42 -0
  220. package/dist/pilot/repo.js.map +1 -0
  221. package/dist/pilot/solve.d.ts +22 -0
  222. package/dist/pilot/solve.js +37 -0
  223. package/dist/pilot/solve.js.map +1 -0
  224. package/dist/pilot/tally.d.ts +35 -0
  225. package/dist/pilot/tally.js +61 -0
  226. package/dist/pilot/tally.js.map +1 -0
  227. package/dist/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
  228. package/dist/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
  229. package/dist/plugins/local-trace-distiller/.mcp.json +8 -0
  230. package/dist/plugins/local-trace-distiller/README.md +27 -0
  231. package/dist/plugins/local-trace-distiller/jinn.plugin.json +36 -0
  232. package/dist/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
  233. package/dist/preflight/rpc-network.d.ts +10 -3
  234. package/dist/preflight/rpc-network.js +46 -13
  235. package/dist/preflight/rpc-network.js.map +1 -1
  236. package/dist/preflight/stable-cwd.d.ts +29 -0
  237. package/dist/preflight/stable-cwd.js +98 -0
  238. package/dist/preflight/stable-cwd.js.map +1 -0
  239. package/dist/solvernets/launched-record-dispatcher.js +6 -0
  240. package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
  241. package/dist/spend/credential.d.ts +2 -2
  242. package/dist/spend/credential.js +9 -3
  243. package/dist/spend/credential.js.map +1 -1
  244. package/dist/spend/spend-cap.d.ts +10 -0
  245. package/dist/spend/spend-cap.js +13 -0
  246. package/dist/spend/spend-cap.js.map +1 -0
  247. package/dist/store/store.d.ts +14 -0
  248. package/dist/store/store.js +10 -1
  249. package/dist/store/store.js.map +1 -1
  250. package/dist/trajectory/processors/identity-scrub.js +22 -3
  251. package/dist/trajectory/processors/identity-scrub.js.map +1 -1
  252. package/dist/trajectory/scrub/build.d.ts +19 -0
  253. package/dist/trajectory/scrub/build.js +25 -0
  254. package/dist/trajectory/scrub/build.js.map +1 -1
  255. package/dist/trajectory/scrub/layer2.d.ts +23 -0
  256. package/dist/trajectory/scrub/layer2.js +33 -0
  257. package/dist/trajectory/scrub/layer2.js.map +1 -0
  258. package/dist/trajectory/scrub/openredaction-stage.d.ts +127 -0
  259. package/dist/trajectory/scrub/openredaction-stage.js +186 -2
  260. package/dist/trajectory/scrub/openredaction-stage.js.map +1 -1
  261. package/dist/trajectory/scrub/pipeline.d.ts +21 -0
  262. package/dist/trajectory/scrub/pipeline.js +57 -0
  263. package/dist/trajectory/scrub/pipeline.js.map +1 -1
  264. package/dist/trajectory/scrub/plain-patterns-stage.d.ts +14 -1
  265. package/dist/trajectory/scrub/plain-patterns-stage.js +35 -5
  266. package/dist/trajectory/scrub/plain-patterns-stage.js.map +1 -1
  267. package/dist/trajectory/scrub/secretlint-stage.d.ts +22 -3
  268. package/dist/trajectory/scrub/secretlint-stage.js +118 -27
  269. package/dist/trajectory/scrub/secretlint-stage.js.map +1 -1
  270. package/dist/trajectory/transcript-watcher.d.ts +26 -0
  271. package/dist/trajectory/transcript-watcher.js +33 -0
  272. package/dist/trajectory/transcript-watcher.js.map +1 -1
  273. package/dist/types/skill-artifact.d.ts +442 -0
  274. package/dist/types/skill-artifact.js +137 -0
  275. package/dist/types/skill-artifact.js.map +1 -0
  276. package/dist/types/task-run-read-model.d.ts +21 -0
  277. package/dist/types/task-run-read-model.js +2 -0
  278. package/dist/types/task-run-read-model.js.map +1 -0
  279. package/dist/types/task-run.d.ts +75 -0
  280. package/dist/types/task-run.js +2 -0
  281. package/dist/types/task-run.js.map +1 -0
  282. package/dist/util/redact-rpc-urls.d.ts +1 -1
  283. package/dist/util/redact-rpc-urls.js +57 -2
  284. package/dist/util/redact-rpc-urls.js.map +1 -1
  285. package/package.json +11 -8
  286. package/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
  287. package/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
  288. package/plugins/local-trace-distiller/.mcp.json +8 -0
  289. package/plugins/local-trace-distiller/README.md +27 -0
  290. package/plugins/local-trace-distiller/jinn.plugin.json +36 -0
  291. package/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
  292. package/dist/api/peers.js.map +0 -1
  293. package/dist/dashboard/assets/index-BsrAAmvC.js +0 -171
  294. package/dist/dashboard/assets/index-DQOWJ2SF.css +0 -1
  295. /package/dist/{api/peers.d.ts → daemon/peer-sync.d.ts} +0 -0
@@ -29,8 +29,135 @@ import type { ScrubStage } from './types.js';
29
29
  * `test-[LAB_8465]-development` — and lab-specimen / exam IDs are not
30
30
  * plausible in agent-trajectory content. Nothing in the seeded-secrets
31
31
  * fixture pins either pattern.
32
+ *
33
+ * #1391 additions (full 42-seed characterisation) — bare-SHAPE patterns
34
+ * whose regex matches ordinary technical tokens with no trigger word at all:
35
+ *
36
+ * - `ZIP_CODE_US` — `\b\d{5}(…)?\b`: ANY 5-digit number. Fired on GitHub
37
+ * issue numbers ("#26251", "#41417"), millisecond values ("60000"), quota
38
+ * figures ("25000"), Lark error codes ("41050"). A bare 5-digit number in
39
+ * trajectory content is overwhelmingly a count, id, or port, not a home
40
+ * address component; street-level address detection is the ML PII stage's
41
+ * job, where the surrounding words disambiguate.
42
+ * - `POSTCODE_UK` — matches hex colour literals ("#FF00FF" → `[POSTCODE]`).
43
+ * Same rationale: a bare alphanumeric cluster is not a location without
44
+ * context, which the ML PII stage has and this regex does not.
45
+ * - `SWIFT_BIC` — `\b[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?\b`: ANY 8- or 11-char
46
+ * uppercase word ("REQUIRED", from an HTTP header name). BIC codes are
47
+ * public bank identifiers, not secrets, and the shape is indistinguishable
48
+ * from an all-caps word.
49
+ * - `TIKTOK_USERNAME` / `SOCIAL_MEDIA_HANDLE` — the #1331 social-handle
50
+ * family: `@`-prefixed bare words. Fired on npm scoped packages
51
+ * ("@n8n/n8n-nodes-langchain…", "@github/copilot-sdk"), which are
52
+ * ubiquitous in technical prose.
32
53
  */
33
54
  export declare const BARE_WORD_PATTERN_DENYLIST: readonly string[];
55
+ /**
56
+ * Trigger-word patterns excluded for #1372 (kept as a separate block from the
57
+ * bare-word denylist above so parallel denylist additions merge cleanly).
58
+ *
59
+ * These share one pathology: an ordinary English trigger word (`TO`,
60
+ * `APPROVAL`, `PROJECT`, `ORDER`, `REVIEW`, `PASS`, `LOT`, `SO`, `REG`, `WO`,
61
+ * `MISSING`, `RETURN`, `user`, `prod`, `ice`…), case-insensitive, followed by
62
+ * a bare `[A-Z0-9]{n,m}` tail with no intrinsic shape. On the published seed
63
+ * skills' SKILL.md prose every one of them fired — all 42 seed bodies were
64
+ * defaced ("project context" → `project [PROJECT_3875]`, "get your approval
65
+ * before" → `approval [AUTH_5211]`), several mid-word ("something" →
66
+ * `so[SO_1826]`, "workflow" → `wo[WO_3602]`, "regressions" →
67
+ * `[REG]ressions`). Observed trigger words per pattern, from the #1372
68
+ * characterisation over five real seed bodies:
69
+ *
70
+ * - `USERNAME` — "user intent", "user has"; a bare word after "user"/"login"
71
+ * is not a credential. Credentials keep their shaped patterns; person
72
+ * names are the ML PII stage's job (see the `NAME` note above).
73
+ * - `PROJECT_CODE` — "project context", "project goes through".
74
+ * - `CARD_AUTH_CODE` — "approval before" (card auth codes travel with card
75
+ * numbers, which `CREDIT_CARD` still catches).
76
+ * - `IATA_AIRPORT_CODE` — "to use" ("TO" + any 3 capitalisable letters).
77
+ * - `JUDGMENT_NUMBER` — "order should".
78
+ * - `STANDING_ORDER_REF` — "SO" matches inside "something"/"solution".
79
+ * - `PRODUCTION_ID` — "production classes"; nested self-replacement
80
+ * corrupted "NO PRODUCTION CODE" into `PROD[PROD[PROD…`.
81
+ * - `WORK_ORDER_NUMBER` — "wo" matches inside "workflow"/"worktree".
82
+ * - `PERFORMANCE_REVIEW_ID` — "performance problems", "evaluation between".
83
+ * - `TNT_TRACKING` — every clause optional except the tail, so ANY 9- or
84
+ * 13-character word matches ("variation", "statement").
85
+ * - `THEME_PARK_TICKET` — "pass immediately".
86
+ * - `TOURNAMENT_REGISTRATION_ID` — "REG" matches inside "regressions".
87
+ * - `MISSING_PERSON_CASE` — "missing requirements".
88
+ * - `RMA_NUMBER` — "return expected".
89
+ * - `BATCH_LOT_NUMBER` — "a lot faster".
90
+ * - `EMERGENCY_CONTACT` — "ice" (unanchored, matches inside "practice")
91
+ * followed by any 2–4 words.
92
+ *
93
+ * Lab-grade coverage loss is acceptable: these label niche reference numbers
94
+ * (parcel tracking, theme-park tickets, tournament brackets, standing
95
+ * orders, RMAs…) that are implausible in agent-trajectory content and carry
96
+ * no shape of their own beyond the trigger word. Genuinely secret-shaped
97
+ * content keeps its dedicated patterns (emails, cards, SSNs, API keys —
98
+ * pinned below and by the harness-layer seeded-secrets fixture), and the
99
+ * secretlint + plain-patterns stages still run behind this one.
100
+ *
101
+ * #1391 additions — the #1372 characterisation ran 5 sample bodies; the
102
+ * full-42-seed sweep surfaced the longer tail below (same pathology, same
103
+ * fix, observed trigger words in parentheses). One aggravator worth naming:
104
+ * openredaction substitutes a detection's captured VALUE case-insensitively
105
+ * across the whole document, so a single trigger FP defaces every other
106
+ * occurrence of that value. Every seed's frontmatter contains
107
+ * `license: MIT` — LICENSE_PLATE captures `MIT`, and every "limit(s)" /
108
+ * "submit" in the body came back as `li[PLATE_2299]s` / `Sub[PLATE_2299]`.
109
+ *
110
+ * - `LICENSE_PLATE` — "license: MIT" (frontmatter, all 42 seeds); `REG`
111
+ * trigger mid-word ("registers" → `[PLATE]isters`).
112
+ * - `US_LICENSE_PLATE` / `INTERNATIONAL_LICENSE_PLATE` — same trigger family
113
+ * (`PLATE|LICENSE|TAG|REGISTRATION`): "tag-driven", "tagged as data".
114
+ * - `EDITORIAL_TICKET` — "edit existing", "edit endpoints" (`EDIT` trigger).
115
+ * - `TRANSACTION_ID` — `TRANS` trigger mid-word: "transformations" →
116
+ * `[TXN]formations`.
117
+ * - `AIRLINE_BOOKING_REFERENCE` — "reference images", "reference videos",
118
+ * "node reference syntax" (`REFERENCE` trigger).
119
+ * - `SOURCE_ID` — "source images", "source directory", "multi-source
120
+ * aggregation".
121
+ * - `SERVICE_REQUEST_NUMBER` — "service discovery", "app-service assessment".
122
+ * - `TERMINAL_ID` — "terminal status"; `POS` trigger mid-word: "false
123
+ * positives", "PostToolUse".
124
+ * - `EXIT_INTERVIEW_ID` — "termination criterion/oracle", "separation
125
+ * exists" (`EXIT|TERMINATION|SEPARATION` triggers).
126
+ * - `HOTEL_LOYALTY_NUMBER` — "member-remove" (wiki commands), "rewards
127
+ * padding" (`MEMBER|LOYALTY|REWARDS` triggers).
128
+ * - `SEARCH_RESCUE_MISSION_ID` — "search operations", "web/search results"
129
+ * (`SEARCH|RESCUE|MISSION` triggers).
130
+ * - `APPLICATION_ID` / `JOB_APPLICATION_ID` — "application gateway",
131
+ * "candidate contradicts", "candidate regions" (`APPLICATION|CANDIDATE|
132
+ * APPLICANT` triggers).
133
+ * - `ARTICLE_ID` — "user story should", "user-story-example" (`STORY`
134
+ * trigger).
135
+ * - `EMERGENCY_CALL_REF` — "incident investigation" (`INCIDENT` trigger).
136
+ * - `CAMPAIGN_CODE` — "brand campaigns", "brand campaign jingle".
137
+ * - `INSTALLATION_REF` — "brew install imagemagick", "apt-get install".
138
+ * - `PRODUCT_SKU` — "SKU changes", "SKU upgrades" (Azure sizing prose).
139
+ * - `BAR_NUMBER` — "raises the bar because" (`BAR` trigger).
140
+ * - `PREMIUM_PAYMENT_REF` — "premium commercial cuts", "premium brand".
141
+ * - `HOUSING_ASSIGNMENT` — "ambient room tone" (`ROOM` trigger).
142
+ * - `MANUSCRIPT_ID` — `MS` trigger: "0.8 ms overhead" → `[MANUSCRIPT]`.
143
+ * - `STATEMENT_REF` — "return statement exists".
144
+ * - `QUOTE_REFERENCE` — "quote shortest decisive line".
145
+ * - `RESUME_ID` — "Resume caveman after" (`RESUME|CV` triggers).
146
+ * - `PAYMENT_REFERENCE` — `PAY` trigger mid-word: "paymentGateway" →
147
+ * `pay[PAY_REF]`.
148
+ * - `ROUTING_NUMBER_MFG` — "routing convention".
149
+ * - `MICROSOFT_CERTIFICATION` — "Microsoft documentation" (`MICROSOFT|MS`
150
+ * triggers).
151
+ *
152
+ * Revealed at fixpoint (iteration 2 — patterns previously shadowed by a
153
+ * higher-priority pattern that the first pass denylisted):
154
+ * - `INCIDENT_REPORT_NUMBER` — "Incident Investigation" (`INCIDENT` trigger,
155
+ * surfaced once EMERGENCY_CALL_REF was gone).
156
+ * - `ENROLLMENT_NUMBER` — "registration succeeds" (`REGISTRATION` trigger).
157
+ * - `HOTEL_RESERVATION` — "Capacity Reservation Groups" (`RESERVATION`
158
+ * trigger, surfaced once AIRLINE_BOOKING_REFERENCE was gone).
159
+ */
160
+ export declare const PROSE_TRIGGER_PATTERN_DENYLIST: readonly string[];
34
161
  /**
35
162
  * Default detector: openredaction's full pattern set minus the audited
36
163
  * bare-word matchers. Built via the `patterns` whitelist option (the
@@ -1,6 +1,6 @@
1
1
  import { OpenRedaction } from 'openredaction';
2
2
  import { classifyKey } from './key-policy.js';
3
- const VERSION = '0.3.0';
3
+ const VERSION = '0.4.0'; // 0.4.0: #1391 full-corpus denylist extensions (42-seed characterisation)
4
4
  /**
5
5
  * Patterns excluded from the default detector (#1331). All three ship with a
6
6
  * bare-word regex (`\b[a-zA-Z0-9._]{3,30}\b` or equivalent) that matches
@@ -29,6 +29,27 @@ const VERSION = '0.3.0';
29
29
  * `test-[LAB_8465]-development` — and lab-specimen / exam IDs are not
30
30
  * plausible in agent-trajectory content. Nothing in the seeded-secrets
31
31
  * fixture pins either pattern.
32
+ *
33
+ * #1391 additions (full 42-seed characterisation) — bare-SHAPE patterns
34
+ * whose regex matches ordinary technical tokens with no trigger word at all:
35
+ *
36
+ * - `ZIP_CODE_US` — `\b\d{5}(…)?\b`: ANY 5-digit number. Fired on GitHub
37
+ * issue numbers ("#26251", "#41417"), millisecond values ("60000"), quota
38
+ * figures ("25000"), Lark error codes ("41050"). A bare 5-digit number in
39
+ * trajectory content is overwhelmingly a count, id, or port, not a home
40
+ * address component; street-level address detection is the ML PII stage's
41
+ * job, where the surrounding words disambiguate.
42
+ * - `POSTCODE_UK` — matches hex colour literals ("#FF00FF" → `[POSTCODE]`).
43
+ * Same rationale: a bare alphanumeric cluster is not a location without
44
+ * context, which the ML PII stage has and this regex does not.
45
+ * - `SWIFT_BIC` — `\b[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?\b`: ANY 8- or 11-char
46
+ * uppercase word ("REQUIRED", from an HTTP header name). BIC codes are
47
+ * public bank identifiers, not secrets, and the shape is indistinguishable
48
+ * from an all-caps word.
49
+ * - `TIKTOK_USERNAME` / `SOCIAL_MEDIA_HANDLE` — the #1331 social-handle
50
+ * family: `@`-prefixed bare words. Fired on npm scoped packages
51
+ * ("@n8n/n8n-nodes-langchain…", "@github/copilot-sdk"), which are
52
+ * ubiquitous in technical prose.
32
53
  */
33
54
  export const BARE_WORD_PATTERN_DENYLIST = [
34
55
  'INSTAGRAM_USERNAME',
@@ -37,6 +58,169 @@ export const BARE_WORD_PATTERN_DENYLIST = [
37
58
  'NAME',
38
59
  'LAB_TEST_ID',
39
60
  'EXAM_ID',
61
+ // #1391:
62
+ 'ZIP_CODE_US',
63
+ 'POSTCODE_UK',
64
+ 'SWIFT_BIC',
65
+ 'TIKTOK_USERNAME',
66
+ 'SOCIAL_MEDIA_HANDLE',
67
+ ];
68
+ /**
69
+ * Trigger-word patterns excluded for #1372 (kept as a separate block from the
70
+ * bare-word denylist above so parallel denylist additions merge cleanly).
71
+ *
72
+ * These share one pathology: an ordinary English trigger word (`TO`,
73
+ * `APPROVAL`, `PROJECT`, `ORDER`, `REVIEW`, `PASS`, `LOT`, `SO`, `REG`, `WO`,
74
+ * `MISSING`, `RETURN`, `user`, `prod`, `ice`…), case-insensitive, followed by
75
+ * a bare `[A-Z0-9]{n,m}` tail with no intrinsic shape. On the published seed
76
+ * skills' SKILL.md prose every one of them fired — all 42 seed bodies were
77
+ * defaced ("project context" → `project [PROJECT_3875]`, "get your approval
78
+ * before" → `approval [AUTH_5211]`), several mid-word ("something" →
79
+ * `so[SO_1826]`, "workflow" → `wo[WO_3602]`, "regressions" →
80
+ * `[REG]ressions`). Observed trigger words per pattern, from the #1372
81
+ * characterisation over five real seed bodies:
82
+ *
83
+ * - `USERNAME` — "user intent", "user has"; a bare word after "user"/"login"
84
+ * is not a credential. Credentials keep their shaped patterns; person
85
+ * names are the ML PII stage's job (see the `NAME` note above).
86
+ * - `PROJECT_CODE` — "project context", "project goes through".
87
+ * - `CARD_AUTH_CODE` — "approval before" (card auth codes travel with card
88
+ * numbers, which `CREDIT_CARD` still catches).
89
+ * - `IATA_AIRPORT_CODE` — "to use" ("TO" + any 3 capitalisable letters).
90
+ * - `JUDGMENT_NUMBER` — "order should".
91
+ * - `STANDING_ORDER_REF` — "SO" matches inside "something"/"solution".
92
+ * - `PRODUCTION_ID` — "production classes"; nested self-replacement
93
+ * corrupted "NO PRODUCTION CODE" into `PROD[PROD[PROD…`.
94
+ * - `WORK_ORDER_NUMBER` — "wo" matches inside "workflow"/"worktree".
95
+ * - `PERFORMANCE_REVIEW_ID` — "performance problems", "evaluation between".
96
+ * - `TNT_TRACKING` — every clause optional except the tail, so ANY 9- or
97
+ * 13-character word matches ("variation", "statement").
98
+ * - `THEME_PARK_TICKET` — "pass immediately".
99
+ * - `TOURNAMENT_REGISTRATION_ID` — "REG" matches inside "regressions".
100
+ * - `MISSING_PERSON_CASE` — "missing requirements".
101
+ * - `RMA_NUMBER` — "return expected".
102
+ * - `BATCH_LOT_NUMBER` — "a lot faster".
103
+ * - `EMERGENCY_CONTACT` — "ice" (unanchored, matches inside "practice")
104
+ * followed by any 2–4 words.
105
+ *
106
+ * Lab-grade coverage loss is acceptable: these label niche reference numbers
107
+ * (parcel tracking, theme-park tickets, tournament brackets, standing
108
+ * orders, RMAs…) that are implausible in agent-trajectory content and carry
109
+ * no shape of their own beyond the trigger word. Genuinely secret-shaped
110
+ * content keeps its dedicated patterns (emails, cards, SSNs, API keys —
111
+ * pinned below and by the harness-layer seeded-secrets fixture), and the
112
+ * secretlint + plain-patterns stages still run behind this one.
113
+ *
114
+ * #1391 additions — the #1372 characterisation ran 5 sample bodies; the
115
+ * full-42-seed sweep surfaced the longer tail below (same pathology, same
116
+ * fix, observed trigger words in parentheses). One aggravator worth naming:
117
+ * openredaction substitutes a detection's captured VALUE case-insensitively
118
+ * across the whole document, so a single trigger FP defaces every other
119
+ * occurrence of that value. Every seed's frontmatter contains
120
+ * `license: MIT` — LICENSE_PLATE captures `MIT`, and every "limit(s)" /
121
+ * "submit" in the body came back as `li[PLATE_2299]s` / `Sub[PLATE_2299]`.
122
+ *
123
+ * - `LICENSE_PLATE` — "license: MIT" (frontmatter, all 42 seeds); `REG`
124
+ * trigger mid-word ("registers" → `[PLATE]isters`).
125
+ * - `US_LICENSE_PLATE` / `INTERNATIONAL_LICENSE_PLATE` — same trigger family
126
+ * (`PLATE|LICENSE|TAG|REGISTRATION`): "tag-driven", "tagged as data".
127
+ * - `EDITORIAL_TICKET` — "edit existing", "edit endpoints" (`EDIT` trigger).
128
+ * - `TRANSACTION_ID` — `TRANS` trigger mid-word: "transformations" →
129
+ * `[TXN]formations`.
130
+ * - `AIRLINE_BOOKING_REFERENCE` — "reference images", "reference videos",
131
+ * "node reference syntax" (`REFERENCE` trigger).
132
+ * - `SOURCE_ID` — "source images", "source directory", "multi-source
133
+ * aggregation".
134
+ * - `SERVICE_REQUEST_NUMBER` — "service discovery", "app-service assessment".
135
+ * - `TERMINAL_ID` — "terminal status"; `POS` trigger mid-word: "false
136
+ * positives", "PostToolUse".
137
+ * - `EXIT_INTERVIEW_ID` — "termination criterion/oracle", "separation
138
+ * exists" (`EXIT|TERMINATION|SEPARATION` triggers).
139
+ * - `HOTEL_LOYALTY_NUMBER` — "member-remove" (wiki commands), "rewards
140
+ * padding" (`MEMBER|LOYALTY|REWARDS` triggers).
141
+ * - `SEARCH_RESCUE_MISSION_ID` — "search operations", "web/search results"
142
+ * (`SEARCH|RESCUE|MISSION` triggers).
143
+ * - `APPLICATION_ID` / `JOB_APPLICATION_ID` — "application gateway",
144
+ * "candidate contradicts", "candidate regions" (`APPLICATION|CANDIDATE|
145
+ * APPLICANT` triggers).
146
+ * - `ARTICLE_ID` — "user story should", "user-story-example" (`STORY`
147
+ * trigger).
148
+ * - `EMERGENCY_CALL_REF` — "incident investigation" (`INCIDENT` trigger).
149
+ * - `CAMPAIGN_CODE` — "brand campaigns", "brand campaign jingle".
150
+ * - `INSTALLATION_REF` — "brew install imagemagick", "apt-get install".
151
+ * - `PRODUCT_SKU` — "SKU changes", "SKU upgrades" (Azure sizing prose).
152
+ * - `BAR_NUMBER` — "raises the bar because" (`BAR` trigger).
153
+ * - `PREMIUM_PAYMENT_REF` — "premium commercial cuts", "premium brand".
154
+ * - `HOUSING_ASSIGNMENT` — "ambient room tone" (`ROOM` trigger).
155
+ * - `MANUSCRIPT_ID` — `MS` trigger: "0.8 ms overhead" → `[MANUSCRIPT]`.
156
+ * - `STATEMENT_REF` — "return statement exists".
157
+ * - `QUOTE_REFERENCE` — "quote shortest decisive line".
158
+ * - `RESUME_ID` — "Resume caveman after" (`RESUME|CV` triggers).
159
+ * - `PAYMENT_REFERENCE` — `PAY` trigger mid-word: "paymentGateway" →
160
+ * `pay[PAY_REF]`.
161
+ * - `ROUTING_NUMBER_MFG` — "routing convention".
162
+ * - `MICROSOFT_CERTIFICATION` — "Microsoft documentation" (`MICROSOFT|MS`
163
+ * triggers).
164
+ *
165
+ * Revealed at fixpoint (iteration 2 — patterns previously shadowed by a
166
+ * higher-priority pattern that the first pass denylisted):
167
+ * - `INCIDENT_REPORT_NUMBER` — "Incident Investigation" (`INCIDENT` trigger,
168
+ * surfaced once EMERGENCY_CALL_REF was gone).
169
+ * - `ENROLLMENT_NUMBER` — "registration succeeds" (`REGISTRATION` trigger).
170
+ * - `HOTEL_RESERVATION` — "Capacity Reservation Groups" (`RESERVATION`
171
+ * trigger, surfaced once AIRLINE_BOOKING_REFERENCE was gone).
172
+ */
173
+ export const PROSE_TRIGGER_PATTERN_DENYLIST = [
174
+ 'USERNAME',
175
+ 'PROJECT_CODE',
176
+ 'CARD_AUTH_CODE',
177
+ 'IATA_AIRPORT_CODE',
178
+ 'JUDGMENT_NUMBER',
179
+ 'STANDING_ORDER_REF',
180
+ 'PRODUCTION_ID',
181
+ 'WORK_ORDER_NUMBER',
182
+ 'PERFORMANCE_REVIEW_ID',
183
+ 'TNT_TRACKING',
184
+ 'THEME_PARK_TICKET',
185
+ 'TOURNAMENT_REGISTRATION_ID',
186
+ 'MISSING_PERSON_CASE',
187
+ 'RMA_NUMBER',
188
+ 'BATCH_LOT_NUMBER',
189
+ 'EMERGENCY_CONTACT',
190
+ // #1391:
191
+ 'LICENSE_PLATE',
192
+ 'US_LICENSE_PLATE',
193
+ 'INTERNATIONAL_LICENSE_PLATE',
194
+ 'EDITORIAL_TICKET',
195
+ 'TRANSACTION_ID',
196
+ 'AIRLINE_BOOKING_REFERENCE',
197
+ 'SOURCE_ID',
198
+ 'SERVICE_REQUEST_NUMBER',
199
+ 'TERMINAL_ID',
200
+ 'EXIT_INTERVIEW_ID',
201
+ 'HOTEL_LOYALTY_NUMBER',
202
+ 'SEARCH_RESCUE_MISSION_ID',
203
+ 'APPLICATION_ID',
204
+ 'JOB_APPLICATION_ID',
205
+ 'ARTICLE_ID',
206
+ 'EMERGENCY_CALL_REF',
207
+ 'CAMPAIGN_CODE',
208
+ 'INSTALLATION_REF',
209
+ 'PRODUCT_SKU',
210
+ 'BAR_NUMBER',
211
+ 'PREMIUM_PAYMENT_REF',
212
+ 'HOUSING_ASSIGNMENT',
213
+ 'MANUSCRIPT_ID',
214
+ 'STATEMENT_REF',
215
+ 'QUOTE_REFERENCE',
216
+ 'RESUME_ID',
217
+ 'PAYMENT_REFERENCE',
218
+ 'ROUTING_NUMBER_MFG',
219
+ 'MICROSOFT_CERTIFICATION',
220
+ // #1391 fixpoint iteration 2:
221
+ 'INCIDENT_REPORT_NUMBER',
222
+ 'ENROLLMENT_NUMBER',
223
+ 'HOTEL_RESERVATION',
40
224
  ];
41
225
  /**
42
226
  * Default detector: openredaction's full pattern set minus the audited
@@ -47,7 +231,7 @@ export const BARE_WORD_PATTERN_DENYLIST = [
47
231
  export function buildDefaultDetector() {
48
232
  const allTypes = [...new Set(new OpenRedaction().getPatterns().map((p) => p.type))];
49
233
  return new OpenRedaction({
50
- patterns: allTypes.filter((t) => !BARE_WORD_PATTERN_DENYLIST.includes(t)),
234
+ patterns: allTypes.filter((t) => !BARE_WORD_PATTERN_DENYLIST.includes(t) && !PROSE_TRIGGER_PATTERN_DENYLIST.includes(t)),
51
235
  });
52
236
  }
53
237
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"openredaction-stage.js","sourceRoot":"","sources":["../../../src/trajectory/scrub/openredaction-stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAG9D,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IAC3D,oBAAoB;IACpB,eAAe;IACf,QAAQ;IACR,MAAM;IACN,aAAa;IACb,SAAS;CACV,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC,WAAW,EAAE,CAA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E,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"openredaction-stage.js","sourceRoot":"","sources":["../../../src/trajectory/scrub/openredaction-stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAG9D,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,0EAA0E;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IAC3D,oBAAoB;IACpB,eAAe;IACf,QAAQ;IACR,MAAM;IACN,aAAa;IACb,SAAS;IACT,SAAS;IACT,aAAa;IACb,aAAa;IACb,WAAW;IACX,iBAAiB;IACjB,qBAAqB;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAsB;IAC/D,UAAU;IACV,cAAc;IACd,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,eAAe;IACf,mBAAmB;IACnB,uBAAuB;IACvB,cAAc;IACd,mBAAmB;IACnB,4BAA4B;IAC5B,qBAAqB;IACrB,YAAY;IACZ,kBAAkB;IAClB,mBAAmB;IACnB,SAAS;IACT,eAAe;IACf,kBAAkB;IAClB,6BAA6B;IAC7B,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,WAAW;IACX,wBAAwB;IACxB,aAAa;IACb,mBAAmB;IACnB,sBAAsB;IACtB,0BAA0B;IAC1B,gBAAgB;IAChB,oBAAoB;IACpB,YAAY;IACZ,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,YAAY;IACZ,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,CAAC,KAAK,CAAC,CAAC;gBAC5C,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;gBAC3B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACpC,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;YACD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -4,6 +4,18 @@ import type { Attributes, ScrubResult, ScrubStage } from './types.js';
4
4
  * attributes feed the next, and redaction records accumulate across the whole
5
5
  * chain. Stages may be async (e.g. the ML PII stage). The `components` list
6
6
  * (stage name + pinned version) is what the signed provenance manifest records.
7
+ *
8
+ * Nested values (#1378): the stages themselves operate on flat string values —
9
+ * a non-string attribute value (e.g. `tool.args` captured as an object) used
10
+ * to pass through every stage untouched and publish verbatim, leaking the
11
+ * exact strings the same pipeline redacted out of `tool.result`. `run()` now
12
+ * walks surviving object/array values after the flat pass and scrubs every
13
+ * string leaf through the same stage chain, keyed by the TOP-LEVEL attribute
14
+ * key so the key policy classifies leaves exactly like the flat value
15
+ * (`jinn.*` structural attributes stay raw; `drop` keys are already gone
16
+ * before the walk). Redactions from leaf runs carry the top-level key, so the
17
+ * redaction manifest and capture redaction diff report `tool.args` as the
18
+ * touched field.
7
19
  */
8
20
  export declare class ScrubPipeline {
9
21
  private readonly stages;
@@ -13,4 +25,13 @@ export declare class ScrubPipeline {
13
25
  version: string;
14
26
  }>;
15
27
  run(attributes: Attributes): Promise<ScrubResult>;
28
+ /** One pass of every stage over a flat attribute bag (the original `run`). */
29
+ private runStages;
30
+ /**
31
+ * Recursively scrub the string leaves of a nested attribute value through
32
+ * the full stage chain, using the top-level attribute key for policy
33
+ * classification. Non-container, non-string values (numbers, booleans,
34
+ * null) and non-plain objects pass through unchanged.
35
+ */
36
+ private scrubNested;
16
37
  }
@@ -3,6 +3,18 @@
3
3
  * attributes feed the next, and redaction records accumulate across the whole
4
4
  * chain. Stages may be async (e.g. the ML PII stage). The `components` list
5
5
  * (stage name + pinned version) is what the signed provenance manifest records.
6
+ *
7
+ * Nested values (#1378): the stages themselves operate on flat string values —
8
+ * a non-string attribute value (e.g. `tool.args` captured as an object) used
9
+ * to pass through every stage untouched and publish verbatim, leaking the
10
+ * exact strings the same pipeline redacted out of `tool.result`. `run()` now
11
+ * walks surviving object/array values after the flat pass and scrubs every
12
+ * string leaf through the same stage chain, keyed by the TOP-LEVEL attribute
13
+ * key so the key policy classifies leaves exactly like the flat value
14
+ * (`jinn.*` structural attributes stay raw; `drop` keys are already gone
15
+ * before the walk). Redactions from leaf runs carry the top-level key, so the
16
+ * redaction manifest and capture redaction diff report `tool.args` as the
17
+ * touched field.
6
18
  */
7
19
  export class ScrubPipeline {
8
20
  stages;
@@ -13,6 +25,18 @@ export class ScrubPipeline {
13
25
  return this.stages.map((s) => ({ name: s.name, version: s.version }));
14
26
  }
15
27
  async run(attributes) {
28
+ const flat = await this.runStages(attributes);
29
+ const out = {};
30
+ const redactions = [...flat.redactions];
31
+ for (const [key, value] of Object.entries(flat.attributes)) {
32
+ // Flat strings were scrubbed by the pass above; only container values
33
+ // (objects/arrays) still hold unscrubbed string leaves.
34
+ out[key] = typeof value === 'string' ? value : await this.scrubNested(key, value, redactions);
35
+ }
36
+ return { attributes: out, redactions };
37
+ }
38
+ /** One pass of every stage over a flat attribute bag (the original `run`). */
39
+ async runStages(attributes) {
16
40
  let current = attributes;
17
41
  const redactions = [];
18
42
  for (const stage of this.stages) {
@@ -22,5 +46,38 @@ export class ScrubPipeline {
22
46
  }
23
47
  return { attributes: current, redactions };
24
48
  }
49
+ /**
50
+ * Recursively scrub the string leaves of a nested attribute value through
51
+ * the full stage chain, using the top-level attribute key for policy
52
+ * classification. Non-container, non-string values (numbers, booleans,
53
+ * null) and non-plain objects pass through unchanged.
54
+ */
55
+ async scrubNested(key, value, redactions) {
56
+ if (typeof value === 'string') {
57
+ const result = await this.runStages({ [key]: value });
58
+ redactions.push(...result.redactions);
59
+ const scrubbed = result.attributes[key];
60
+ // Stages only rewrite strings; a `drop`-classified key never reaches
61
+ // here (dropped in the flat pass), so non-string means untouched.
62
+ return typeof scrubbed === 'string' ? scrubbed : value;
63
+ }
64
+ if (Array.isArray(value)) {
65
+ const items = [];
66
+ for (const item of value)
67
+ items.push(await this.scrubNested(key, item, redactions));
68
+ return items;
69
+ }
70
+ if (value !== null && typeof value === 'object') {
71
+ const proto = Object.getPrototypeOf(value);
72
+ if (proto !== Object.prototype && proto !== null)
73
+ return value; // non-plain: pass through
74
+ const entries = {};
75
+ for (const [k, v] of Object.entries(value)) {
76
+ entries[k] = await this.scrubNested(key, v, redactions);
77
+ }
78
+ return entries;
79
+ }
80
+ return value;
81
+ }
25
82
  }
26
83
  //# sourceMappingURL=pipeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../src/trajectory/scrub/pipeline.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACK;IAA7B,YAA6B,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAErD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,UAAsB;QAC9B,IAAI,OAAO,GAAG,UAAU,CAAC;QACzB,MAAM,UAAU,GAAsB,EAAE,CAAC;QACzC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,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AG,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAChD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC3C,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,IAAI,KAAK,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC,CAAC,0BAA0B;YAC1F,MAAM,OAAO,GAA4B,EAAE,CAAC;YAC5C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;gBACtE,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -12,7 +12,20 @@
12
12
  * capture publish path and the harness layer share ONE implementation.
13
13
  * Deliberately broad: over-redacting an email or a username is cheap; leaking
14
14
  * one is not.
15
+ *
16
+ * An opt-in third set (`credentialIds`, #1415) adds deterministic cloud
17
+ * credential-ID prefixes for the seed profile, which runs without the entropy
18
+ * fallback that covers these shapes in the trace profile.
15
19
  */
16
20
  import { type KeyPolicy } from './key-policy.js';
17
21
  import type { ScrubStage } from './types.js';
18
- export declare function plainPatternsStage(policy: KeyPolicy): ScrubStage;
22
+ export interface PlainPatternsOptions {
23
+ /**
24
+ * Adds the deterministic credential-ID prefixes above (#1415). Default false:
25
+ * the trace profile already catches these via secretlint's entropy fallback
26
+ * and must stay byte-identical. The seed profile (which runs without the
27
+ * fallback) turns this on.
28
+ */
29
+ credentialIds?: boolean;
30
+ }
31
+ export declare function plainPatternsStage(policy: KeyPolicy, opts?: PlainPatternsOptions): ScrubStage;
@@ -12,6 +12,10 @@
12
12
  * capture publish path and the harness layer share ONE implementation.
13
13
  * Deliberately broad: over-redacting an email or a username is cheap; leaking
14
14
  * one is not.
15
+ *
16
+ * An opt-in third set (`credentialIds`, #1415) adds deterministic cloud
17
+ * credential-ID prefixes for the seed profile, which runs without the entropy
18
+ * fallback that covers these shapes in the trace profile.
15
19
  */
16
20
  import { classifyKey } from './key-policy.js';
17
21
  const VERSION = '0.1.0';
@@ -20,10 +24,36 @@ const EMAIL_PATTERN = /[A-Za-z0-9._%+-]+@[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])
20
24
  /** POSIX home-dir path segment carrying a username. */
21
25
  const HOME_PATH_PATTERN = /\/(?:Users|home)\/[^/\s"'`]+/g;
22
26
  const PATTERNS = [
23
- { pattern: EMAIL_PATTERN, replacement: '[EMAIL]', detail: 'email' },
24
- { pattern: HOME_PATH_PATTERN, replacement: '/users/anon', detail: 'home-path' },
27
+ { pattern: EMAIL_PATTERN, replacement: '[EMAIL]', detail: 'email', kind: 'pii' },
28
+ { pattern: HOME_PATH_PATTERN, replacement: '/users/anon', detail: 'home-path', kind: 'pii' },
29
+ ];
30
+ /**
31
+ * Bare AWS access-key ID — the fixed four-char prefixes + 16 key chars that
32
+ * secretlint's aws rule only scans for under `enableIDScanRule: true`, which
33
+ * preset-recommend leaves off (#1415).
34
+ */
35
+ const AWS_KEY_ID_PATTERN = /\b(?:A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\b/g;
36
+ /**
37
+ * GCP API key: fixed `AIza` prefix + 35 key chars. No trailing `\b` — the key
38
+ * charset includes `-`, which breaks word-boundary semantics at the end.
39
+ */
40
+ const GCP_API_KEY_PATTERN = /\bAIza[0-9A-Za-z_-]{35}/g;
41
+ const CREDENTIAL_ID_PATTERNS = [
42
+ {
43
+ pattern: AWS_KEY_ID_PATTERN,
44
+ replacement: '[SECRET:aws-access-key-id]',
45
+ detail: 'aws-access-key-id',
46
+ kind: 'secret',
47
+ },
48
+ {
49
+ pattern: GCP_API_KEY_PATTERN,
50
+ replacement: '[SECRET:gcp-api-key]',
51
+ detail: 'gcp-api-key',
52
+ kind: 'secret',
53
+ },
25
54
  ];
26
- export function plainPatternsStage(policy) {
55
+ export function plainPatternsStage(policy, opts = {}) {
56
+ const patterns = opts.credentialIds ? [...PATTERNS, ...CREDENTIAL_ID_PATTERNS] : PATTERNS;
27
57
  return {
28
58
  name: 'plain-patterns',
29
59
  version: VERSION,
@@ -36,14 +66,14 @@ export function plainPatternsStage(policy) {
36
66
  continue;
37
67
  }
38
68
  let scrubbed = value;
39
- for (const { pattern, replacement, detail } of PATTERNS) {
69
+ for (const { pattern, replacement, detail, kind } of patterns) {
40
70
  let hits = 0;
41
71
  scrubbed = scrubbed.replace(pattern, () => {
42
72
  hits += 1;
43
73
  return replacement;
44
74
  });
45
75
  for (let i = 0; i < hits; i += 1) {
46
- redactions.push({ key, stage: 'plain-patterns', kind: 'pii', detail });
76
+ redactions.push({ key, stage: 'plain-patterns', kind, detail });
47
77
  }
48
78
  }
49
79
  out[key] = scrubbed;
@@ -1 +1 @@
1
- {"version":3,"file":"plain-patterns-stage.js","sourceRoot":"","sources":["../../../src/trajectory/scrub/plain-patterns-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAG9D,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,yBAAyB;AACzB,MAAM,aAAa,GACjB,4GAA4G,CAAC;AAE/G,uDAAuD;AACvD,MAAM,iBAAiB,GAAG,+BAA+B,CAAC;AAE1D,MAAM,QAAQ,GAAoE;IAChF,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE;IACnE,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,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K,CAAC,UAAsB;YAC1B,MAAM,GAAG,GAAe,EAAE,CAAC;YAC3B,MAAM,UAAU,GAAsB,EAAE,CAAC;YACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBACtD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;oBACxE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;oBACjB,SAAS;gBACX,CAAC;gBACD,IAAI,QAAQ,GAAG,KAAK,CAAC;gBACrB,KAAK,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,QAAQ,EAAE,CAAC;oBAC9D,IAAI,IAAI,GAAG,CAAC,CAAC;oBACb,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE;wBACxC,IAAI,IAAI,CAAC,CAAC;wBACV,OAAO,WAAW,CAAC;oBACrB,CAAC,CAAC,CAAC;oBACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;wBACjC,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;oBAClE,CAAC;gBACH,CAAC;gBACD,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;YACtB,CAAC;YACD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -2,8 +2,11 @@ import { type KeyPolicy } from './key-policy.js';
2
2
  import type { ScrubStage } from './types.js';
3
3
  /**
4
4
  * Secrets stage. Two passes over each `content`-classified string value:
5
- * 1. secretlint preset-recommend rules (AWS, GitHub, Slack, GCP, npm, …) —
6
- * each match replaced inline with `[SECRET:<rule>]`.
5
+ * 1. secretlint preset-recommend rules (AWS secret-key assignments, GitHub,
6
+ * Slack, npm, GCP service-account JSON, …) — each match replaced inline
7
+ * with `[SECRET:<rule>]`. Note the preset's defaults are narrower than the
8
+ * rule names suggest: bare AWS key IDs (AKIA…) and `AIza…` GCP API keys
9
+ * are NOT detected in this pass.
7
10
  * 2. a conservative Shannon-entropy + secret-shape fallback that catches
8
11
  * near-random tokens no specific rule matched (≥ 20 chars by entropy alone,
9
12
  * or 16–19 chars when the token is a single high-density secret-charset run
@@ -13,4 +16,20 @@ import type { ScrubStage } from './types.js';
13
16
  * secret embedded as a path segment still redacts.
14
17
  * `safe` and non-string values pass through untouched.
15
18
  */
16
- export declare function secretlintStage(policy: KeyPolicy): ScrubStage;
19
+ export interface SecretlintStageOptions {
20
+ /**
21
+ * Gate for the pass-2 Shannon-entropy fallback (#1409). Default true (trace
22
+ * profile, unchanged). The seed-import profile sets false: SKILL.md bodies
23
+ * are public licence-checked prose where the probabilistic sweep demonstrably
24
+ * false-positives (env-var assignments with dated slugs, ≥20-char camelCase
25
+ * identifiers) — pass-1 deterministic rules still run unconditionally. With
26
+ * the fallback off, bare AWS key IDs (AKIA…), `AIza…` GCP API keys, JWTs,
27
+ * and generic high-entropy blobs pass this stage unredacted (pass-1 catches
28
+ * AWS secret-key assignments and GCP service-account JSON only). The seed
29
+ * profile covers the AWS/GCP key-ID shapes upstream in plain-patterns
30
+ * (#1415); the JWT / high-entropy residual is accepted for public,
31
+ * licence-checked seed content.
32
+ */
33
+ entropyFallback?: boolean;
34
+ }
35
+ export declare function secretlintStage(policy: KeyPolicy, opts?: SecretlintStageOptions): ScrubStage;