@oneie/claude 0.8.0 → 0.10.0

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 (230) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/agents/abm-strategist.md +67 -1
  3. package/agents/ads-meta.md +67 -1
  4. package/agents/analyst.md +67 -1
  5. package/agents/animator.md +108 -0
  6. package/agents/architect.md +269 -20
  7. package/agents/brand-guardian.md +67 -1
  8. package/agents/brand-strategist.md +67 -1
  9. package/agents/campaign-content.md +67 -1
  10. package/agents/campaign-email.md +67 -1
  11. package/agents/campaign-sms.md +67 -1
  12. package/agents/campaign-social.md +67 -1
  13. package/agents/cco.md +83 -2
  14. package/agents/ceo.md +108 -11
  15. package/agents/chairman.md +197 -0
  16. package/agents/cmo.md +82 -2
  17. package/agents/community-greeter.md +67 -1
  18. package/agents/community-moderator.md +67 -1
  19. package/agents/compliance.md +67 -1
  20. package/agents/copywriter.md +67 -1
  21. package/agents/creative-strategist.md +67 -1
  22. package/agents/cro.md +81 -1
  23. package/agents/cto.md +266 -28
  24. package/agents/customer-interviewer.md +67 -1
  25. package/agents/customer-researcher.md +67 -1
  26. package/agents/customer-success-manager.md +67 -1
  27. package/agents/customer-trainer.md +67 -1
  28. package/agents/cxo.md +82 -1
  29. package/agents/demand-creator.md +67 -1
  30. package/agents/demo-mover.md +67 -1
  31. package/agents/demo-specialist.md +67 -1
  32. package/agents/demo-thai-family-law.md +67 -1
  33. package/agents/designer.md +67 -1
  34. package/agents/discovery-caller.md +67 -1
  35. package/agents/doctor.md +269 -0
  36. package/agents/educate-coach.md +67 -1
  37. package/agents/elevate-tutor.md +67 -1
  38. package/agents/email-lifecycle-marketer.md +67 -1
  39. package/agents/engage-specialist.md +67 -1
  40. package/agents/events-coordinator.md +67 -1
  41. package/agents/foundation-builder.md +67 -1
  42. package/agents/funnel-architect.md +67 -1
  43. package/agents/gift-creator.md +67 -1
  44. package/agents/google-ads.md +67 -1
  45. package/agents/guide.md +67 -1
  46. package/agents/helpdesk-dispatcher.md +67 -1
  47. package/agents/hook-specialist.md +67 -1
  48. package/agents/identify-optimizer.md +67 -1
  49. package/agents/implementer.md +313 -45
  50. package/agents/incident-commander.md +67 -1
  51. package/agents/insights-lead.md +87 -1
  52. package/agents/journey-runner.md +67 -1
  53. package/agents/linkedin-ads.md +67 -1
  54. package/agents/live-sales-chat.md +67 -1
  55. package/agents/market-researcher.md +67 -1
  56. package/agents/media-buyer.md +67 -1
  57. package/agents/memory-keeper.md +195 -0
  58. package/agents/movers-customer-researcher.md +67 -1
  59. package/agents/movers-foundation-builder.md +67 -1
  60. package/agents/movers-market-researcher.md +67 -1
  61. package/agents/movers-pricing-strategist.md +67 -1
  62. package/agents/nurture-architect.md +67 -1
  63. package/agents/offer-architect.md +67 -1
  64. package/agents/onboarder.md +67 -1
  65. package/agents/onboarding-specialist.md +67 -1
  66. package/agents/operations-dashboard.md +87 -1
  67. package/agents/perf-engineer.md +333 -37
  68. package/agents/playbook-writer.md +67 -1
  69. package/agents/plg-strategist.md +67 -1
  70. package/agents/positioning-architect.md +67 -1
  71. package/agents/press-officer.md +67 -1
  72. package/agents/pricing-strategist.md +67 -1
  73. package/agents/privacy-officer.md +67 -1
  74. package/agents/referral-manager.md +67 -1
  75. package/agents/refine-analyst.md +67 -1
  76. package/agents/release-manager.md +446 -39
  77. package/agents/renewals-upsell-rep.md +67 -1
  78. package/agents/review-engineer.md +319 -45
  79. package/agents/rewards-steward.md +67 -1
  80. package/agents/sales-call-coach.md +67 -1
  81. package/agents/sales-closer.md +67 -1
  82. package/agents/security-auditor.md +343 -48
  83. package/agents/sell-closer.md +67 -1
  84. package/agents/share-amplifier.md +67 -1
  85. package/agents/social-media-manager.md +67 -1
  86. package/agents/storyteller.md +301 -0
  87. package/agents/strategist.md +67 -1
  88. package/agents/strategy-aligner.md +67 -1
  89. package/agents/support-agent.md +67 -1
  90. package/agents/tagger.md +327 -0
  91. package/agents/tech-writer.md +195 -22
  92. package/agents/test-engineer.md +398 -29
  93. package/agents/tiktok-ads.md +67 -1
  94. package/agents/tracking-engineer.md +67 -1
  95. package/agents/trailkeeper.md +181 -0
  96. package/agents/upsell-strategist.md +67 -1
  97. package/agents/voice.md +67 -1
  98. package/agents/w1-recon.md +1 -1
  99. package/agents/w2-decide.md +1 -1
  100. package/agents/w3-edit.md +8 -2
  101. package/agents/w4-verify.md +13 -0
  102. package/agents/workflow-optimiser.md +81 -1
  103. package/commands/close.md +916 -160
  104. package/commands/deploy.md +102 -724
  105. package/commands/do.md +58 -2
  106. package/commands/sweep.md +159 -0
  107. package/commands/tasks.md +222 -0
  108. package/hooks/scripts/dev-only.sh +135 -0
  109. package/hooks/scripts/git-add-guard.sh +37 -2
  110. package/hooks/scripts/session-start.sh +32 -4
  111. package/package.json +1 -1
  112. package/rules/scripts.md +85 -0
  113. package/scripts/CLAUDE.md +315 -0
  114. package/scripts/ad-copy-lint.sh +656 -0
  115. package/scripts/agent-actor-parity.sh +129 -0
  116. package/scripts/blocks-manifest-cached.sh +100 -0
  117. package/scripts/chat-context-check.sh +89 -0
  118. package/scripts/chrome.mjs +18 -0
  119. package/scripts/close-metrics.sh +587 -0
  120. package/scripts/close-owner.sh +326 -0
  121. package/scripts/db-sync-lock-check.sh +116 -0
  122. package/scripts/deploy-emit.sh +311 -0
  123. package/scripts/deploy-gate-check.sh +155 -0
  124. package/scripts/deploy-ready.sh +78 -0
  125. package/scripts/deploy-record.sh +605 -0
  126. package/scripts/deploy-schema-check.sh +58 -0
  127. package/scripts/deploy.sh +393 -243
  128. package/scripts/do-auto.sh +127 -26
  129. package/scripts/do-board.sh +429 -0
  130. package/scripts/do-close.sh +1184 -0
  131. package/scripts/do-consumer-sweep.sh +18 -1
  132. package/scripts/do-decide.sh +476 -0
  133. package/scripts/do-fleet.sh +8 -2
  134. package/scripts/do-plan-json.mjs +110 -12
  135. package/scripts/do-prove-selftest.sh +108 -0
  136. package/scripts/do-prove.sh +86 -10
  137. package/scripts/do-rank.py +200 -3
  138. package/scripts/do-reconcile.sh +73 -12
  139. package/scripts/do-signal.sh +101 -23
  140. package/scripts/do-smoke.sh +18 -1
  141. package/scripts/do-w4-gates.sh +11 -1
  142. package/scripts/do-world-check.sh +153 -0
  143. package/scripts/download-stats.sh +172 -0
  144. package/scripts/factory-brief-check.sh +330 -0
  145. package/scripts/factory-check.sh +18 -1
  146. package/scripts/factory-close-check.sh +257 -0
  147. package/scripts/factory-emit.sh +211 -0
  148. package/scripts/factory-executor-check.mjs +353 -0
  149. package/scripts/factory-peak.sh +301 -0
  150. package/scripts/factory-repo.sh +71 -0
  151. package/scripts/factory-review-check.mjs +61 -0
  152. package/scripts/factory-tasks-check.sh +18 -1
  153. package/scripts/fixtures/factory-brief-real.md +44 -0
  154. package/scripts/flywheel-outcome.sh +63 -0
  155. package/scripts/gate-reaper-check.sh +98 -0
  156. package/scripts/gate-reaper.sh +9 -0
  157. package/scripts/gate-watchdog.sh +619 -0
  158. package/scripts/gc-content-check.sh +142 -0
  159. package/scripts/gh-traffic-capture.sh +153 -0
  160. package/scripts/govern-order-check.sh +202 -0
  161. package/scripts/governor-doors-check.sh +86 -5
  162. package/scripts/health.sh +448 -0
  163. package/scripts/id-inventory.mjs +418 -0
  164. package/scripts/incident.sh +212 -0
  165. package/scripts/land.sh +755 -45
  166. package/scripts/lib/gc-finished.sh +77 -0
  167. package/scripts/livekit-ratchet.sh +18 -1
  168. package/scripts/machine-check.sh +1 -1
  169. package/scripts/memory-index-budget.sh +79 -0
  170. package/scripts/npm-downloads.sh +109 -0
  171. package/scripts/one-agents.mjs +204 -8
  172. package/scripts/one-resume.sh +31 -3
  173. package/scripts/pr-body.sh +335 -0
  174. package/scripts/preview-fd-check.sh +289 -0
  175. package/scripts/redirect-lint.sh +169 -0
  176. package/scripts/release.sh +40 -6
  177. package/scripts/resume-lost-sessions.sh +68 -0
  178. package/scripts/shoot-pages.mjs +140 -0
  179. package/scripts/signal-meta-backfill.ts +451 -0
  180. package/scripts/signal-watch.sh +63 -6
  181. package/scripts/speed-cache-check.sh +12 -2
  182. package/scripts/sweep.sh +426 -0
  183. package/scripts/task-titles-dump.ts +101 -0
  184. package/scripts/test-cached.sh +47 -10
  185. package/scripts/test-lanes.sh +14 -0
  186. package/scripts/thread-name-backfill.ts +215 -0
  187. package/scripts/triage-shape-check.sh +149 -0
  188. package/scripts/tsc-cached.sh +155 -8
  189. package/scripts/typedb-flake-check.sh +3 -1
  190. package/scripts/urls-lint.sh +8 -0
  191. package/scripts/verify-board-doors.sh +80 -0
  192. package/scripts/verify-fast.sh +159 -6
  193. package/scripts/worktree-up.sh +21 -3
  194. package/skills/astro/SKILL.md +9 -3
  195. package/skills/astro/optimize-performance.md +3 -2
  196. package/skills/cloudflare/SKILL.md +3 -2
  197. package/skills/cloudflare-security-audit/AI-AND-LLM.md +83 -0
  198. package/skills/cloudflare-security-audit/ATTACK-CLASSES.md +130 -0
  199. package/skills/cloudflare-security-audit/CLIENT-SIDE.md +83 -0
  200. package/skills/cloudflare-security-audit/CLOUD-AND-DEPLOYMENT.md +86 -0
  201. package/skills/cloudflare-security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
  202. package/skills/cloudflare-security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
  203. package/skills/cloudflare-security-audit/HUNTING.md +251 -0
  204. package/skills/cloudflare-security-audit/LICENSE +21 -0
  205. package/skills/cloudflare-security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -0
  206. package/skills/cloudflare-security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
  207. package/skills/cloudflare-security-audit/PROVENANCE.md +78 -0
  208. package/skills/cloudflare-security-audit/RECONNAISSANCE.md +156 -0
  209. package/skills/cloudflare-security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
  210. package/skills/cloudflare-security-audit/SKILL.md +192 -0
  211. package/skills/cloudflare-security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
  212. package/skills/cloudflare-security-audit/VALIDATION-AND-REPORTING.md +186 -0
  213. package/skills/cloudflare-security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -0
  214. package/skills/cloudflare-security-audit/report-schema.json +461 -0
  215. package/skills/cloudflare-security-audit/validate-coverage-ledger.cjs +872 -0
  216. package/skills/cloudflare-security-audit/validate-coverage-ledger.test.cjs +740 -0
  217. package/skills/cloudflare-security-audit/validate-findings.cjs +773 -0
  218. package/skills/cloudflare-security-audit/validate-findings.test.cjs +652 -0
  219. package/skills/deploy/REFERENCE.md +713 -0
  220. package/skills/deploy/SKILL.md +140 -0
  221. package/skills/fleet-audit/SKILL.md +58 -0
  222. package/skills/meeting/SKILL.md +220 -0
  223. package/skills/planning/SKILL.md +256 -0
  224. package/skills/shadcn/SKILL.md +1 -1
  225. package/skills/typedb/SKILL.md +7 -0
  226. package/skills/voice/SKILL.md +94 -6
  227. package/skills/voice/corpus-check.sh +87 -0
  228. package/templates/template-agent.md +7 -1
  229. package/templates/template-feature.md +9 -0
  230. package/templates/template-todo.md +29 -0
@@ -0,0 +1,740 @@
1
+ const assert = require("node:assert/strict");
2
+ const fs = require("node:fs");
3
+ const os = require("node:os");
4
+ const path = require("node:path");
5
+ const { spawnSync } = require("node:child_process");
6
+ const test = require("node:test");
7
+ const {
8
+ LIMITS,
9
+ canonicalCoverageId,
10
+ encodeCanonicalRef,
11
+ isSafeAgentId,
12
+ isSafeRelativePath,
13
+ preflightJsonText,
14
+ validateDocument,
15
+ } = require("./validate-coverage-ledger.cjs");
16
+
17
+ const validatorPath = path.join(__dirname, "validate-coverage-ledger.cjs");
18
+ const CLI_TIMEOUT_MS = 5000;
19
+ const HOSTILE_CLI_TIMEOUT_MS = 15000;
20
+ const HAS_SAFE_INPUT_OPEN = Number.isInteger(fs.constants.O_NOFOLLOW) &&
21
+ fs.constants.O_NOFOLLOW !== 0 &&
22
+ Number.isInteger(fs.constants.O_NONBLOCK) &&
23
+ fs.constants.O_NONBLOCK !== 0;
24
+
25
+ function unit(overrides = {}) {
26
+ const canonicalRefs = overrides.canonical_refs || {
27
+ surface: "src/router.ts#POST /users/:id",
28
+ boundary: "src/authz.ts#requireOwner",
29
+ subsystem: "packages/api",
30
+ attack_class: "ATTACK-CLASSES.md#Access control",
31
+ };
32
+ const value = {
33
+ coverage_id: canonicalCoverageId(canonicalRefs),
34
+ canonical_refs: canonicalRefs,
35
+ surface: "Update-user route",
36
+ boundary: "Object ownership",
37
+ subsystem: "API",
38
+ attack_class: "Access control",
39
+ starting_paths: ["src/router.ts", "src/authz.ts"],
40
+ ordinary_attack_class_block: "ATTACK-CLASSES.md#Access control",
41
+ selected_companion_blocks: [],
42
+ excluded_blocks: [{ block: "WEB-PROTOCOL-AND-AUTH.md#Cache behavior", reason: "The route is not cached." }],
43
+ prior_status: "new",
44
+ attempts: [],
45
+ wave: 1,
46
+ status: "planned",
47
+ agent_id: null,
48
+ reviewed_paths: [],
49
+ local_checks: [],
50
+ result_fingerprints: [],
51
+ unresolved: [],
52
+ };
53
+ return Object.assign(value, overrides, { canonical_refs: canonicalRefs });
54
+ }
55
+
56
+ function errorsFor(value) {
57
+ return validateDocument(value);
58
+ }
59
+
60
+ function runCli(contents, options = {}) {
61
+ const { nodeArgs = [], timeout = CLI_TIMEOUT_MS } = options;
62
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), "validate-coverage-ledger-"));
63
+ const ledgerPath = path.join(directory, "coverage-ledger.json");
64
+ try {
65
+ fs.writeFileSync(ledgerPath, contents);
66
+ return spawnSync(process.execPath, [...nodeArgs, validatorPath, ledgerPath], {
67
+ encoding: "utf8",
68
+ timeout,
69
+ });
70
+ } finally {
71
+ fs.rmSync(directory, { recursive: true, force: true });
72
+ }
73
+ }
74
+
75
+ function cliOutput(result) {
76
+ return `${result.stdout}${result.stderr}`;
77
+ }
78
+
79
+ const TERMINAL_CONTROL_PAYLOAD = "\u001b\u0007\u0085\u202e";
80
+ const TERMINAL_CONTROL_BYTES = [
81
+ Buffer.from([0x1b]),
82
+ Buffer.from([0x07]),
83
+ Buffer.from("\u0085"),
84
+ Buffer.from("\u202e"),
85
+ ];
86
+
87
+ function assertNoInjectedControlBytes(output) {
88
+ const bytes = Buffer.isBuffer(output) ? output : Buffer.from(output, "utf8");
89
+ for (const marker of TERMINAL_CONTROL_BYTES) {
90
+ assert.equal(bytes.indexOf(marker), -1, `found raw control bytes ${marker.toString("hex")}`);
91
+ }
92
+ }
93
+
94
+ function sourceCheck(agentId = "hunter-1", overrides = {}) {
95
+ return {
96
+ agent_id: agentId,
97
+ reviewed_paths: ["src/router.ts"],
98
+ invariant: "The route checks object ownership.",
99
+ method: "source",
100
+ result: "The owner check applies before the update.",
101
+ artifact: null,
102
+ ...overrides,
103
+ };
104
+ }
105
+
106
+ function localCheck(agentId = "hunter-1", overrides = {}) {
107
+ return sourceCheck(agentId, {
108
+ method: "local",
109
+ result: "The bounded fixture accepted the other owner's object.",
110
+ artifact: `agents/${agentId}/artifacts/result.txt`,
111
+ ...overrides,
112
+ });
113
+ }
114
+
115
+ function archivedAttempt(overrides = {}) {
116
+ const value = {
117
+ wave: 1,
118
+ status: "blocked",
119
+ agent_id: "hunter-1",
120
+ reviewed_paths: ["src/router.ts"],
121
+ local_checks: [sourceCheck()],
122
+ result_fingerprints: [],
123
+ unresolved: ["The deployed policy is unavailable."],
124
+ reassignment_reason: "The critic found an unchecked parallel path.",
125
+ };
126
+ return Object.assign(value, overrides);
127
+ }
128
+
129
+ test("accepts an empty ledger and complete units", () => {
130
+ assert.deepEqual(errorsFor([]), []);
131
+ assert.deepEqual(errorsFor([unit()]), []);
132
+
133
+ const missingAttempts = unit();
134
+ delete missingAttempts.attempts;
135
+ assert(errorsFor([missingAttempts]).some((error) => error.includes('missing required field "attempts"')));
136
+
137
+ const covered = unit({
138
+ status: "covered",
139
+ agent_id: "hunter-1",
140
+ reviewed_paths: ["src/router.ts"],
141
+ local_checks: [sourceCheck()],
142
+ });
143
+ assert.deepEqual(errorsFor([covered]), []);
144
+ });
145
+
146
+ test("accepts a complete ledger through the CLI", { skip: !HAS_SAFE_INPUT_OPEN }, () => {
147
+ const result = runCli(JSON.stringify([unit()]));
148
+ assert.equal(result.status, 0, cliOutput(result));
149
+ assert.match(result.stdout, /PASS: 1 coverage units valid/);
150
+ });
151
+
152
+ test("text preflight ignores structural characters and escapes inside strings", () => {
153
+ const value = unit({
154
+ surface: "Route \\ slash [list] {object}, colon: quoted \"value\"",
155
+ excluded_blocks: [{
156
+ block: "COMPANION.md#Literal [brackets] {braces}",
157
+ reason: "The text contains a backslash \\ before an escaped \"quote\".",
158
+ }],
159
+ });
160
+ const contents = JSON.stringify([value]);
161
+ assert.doesNotThrow(() => preflightJsonText(contents));
162
+ assert.deepEqual(JSON.parse(contents), [value]);
163
+ if (HAS_SAFE_INPUT_OPEN) {
164
+ const result = runCli(contents);
165
+ assert.equal(result.status, 0, cliOutput(result));
166
+ }
167
+ });
168
+
169
+ test("text preflight enforces structural cardinality limits", () => {
170
+ const depthLimit = LIMITS.nestingDepth;
171
+ assert.doesNotThrow(() => preflightJsonText(`${"[".repeat(depthLimit)}0${"]".repeat(depthLimit)}`));
172
+ assert.throws(
173
+ () => preflightJsonText(`${"[".repeat(depthLimit + 1)}0${"]".repeat(depthLimit + 1)}`),
174
+ /exceeds nesting depth limit 64/,
175
+ );
176
+
177
+ const tooManyUnits = `[${"null,".repeat(LIMITS.units)}null]`;
178
+ assert.throws(() => preflightJsonText(tooManyUnits), /exceeds 10000 top-level unit limit/);
179
+
180
+ const tooManyItems = `[[${"null,".repeat(LIMITS.collectionItems)}null]]`;
181
+ assert.throws(() => preflightJsonText(tooManyItems), /exceeds 1000 item array limit/);
182
+
183
+ const objectFields = Array.from(
184
+ { length: LIMITS.objectFields + 1 },
185
+ (_, index) => `"field${index}":null`,
186
+ ).join(",");
187
+ assert.throws(() => preflightJsonText(`[{${objectFields}}]`), /exceeds 1000 field object limit/);
188
+
189
+ const fullArray = `[${"null,".repeat(LIMITS.collectionItems - 1)}null]`;
190
+ const arraysNeeded = Math.floor(LIMITS.preflightValues / (LIMITS.collectionItems + 1)) + 1;
191
+ const tooManyValues = `[${Array.from({ length: arraysNeeded }, () => fullArray).join(",")}]`;
192
+ assert.throws(() => preflightJsonText(tooManyValues), /exceeds 500000 total value limit/);
193
+ });
194
+
195
+ test("text preflight rejects malformed structural truncation cleanly", () => {
196
+ assert.throws(() => preflightJsonText("["), /truncated JSON structure/);
197
+ assert.throws(() => preflightJsonText("[\"unterminated"), /unterminated JSON string/);
198
+ assert.throws(() => preflightJsonText("[{\"field\":1]"), /mismatched JSON containers/);
199
+ });
200
+
201
+ test("derives collision-free canonical IDs from exact UTF-8 references", () => {
202
+ assert.equal(encodeCanonicalRef("route:POST /users"), "route%3APOST%20%2Fusers");
203
+ assert.notEqual(encodeCanonicalRef("route name"), encodeCanonicalRef("route-name"));
204
+ assert.equal(
205
+ canonicalCoverageId({ surface: "a", boundary: "b", subsystem: "c", attack_class: "d", lifecycle: "retry" }),
206
+ "a::b::c::d::retry",
207
+ );
208
+ assert.throws(() => encodeCanonicalRef("e\u0301"), /invalid canonical reference/);
209
+ assert.throws(() => encodeCanonicalRef("bad\u0000ref"), /invalid canonical reference/);
210
+ assert.throws(() => encodeCanonicalRef("hidden\u200bref"), /invalid canonical reference/);
211
+ });
212
+
213
+ test("rejects noncanonical, duplicate, and colliding IDs", () => {
214
+ const wrong = unit({ coverage_id: "display-label-slug" });
215
+ assert(errorsFor([wrong]).some((error) => error.includes("expected canonical ID")));
216
+
217
+ const duplicate = unit();
218
+ assert(errorsFor([duplicate, unit()]).some((error) => error.includes("duplicate coverage ID")));
219
+
220
+ const collision = unit();
221
+ const differentMeaning = unit({ surface: "Delete-user route" });
222
+ assert(errorsFor([collision, differentMeaning]).some((error) => error.includes("canonical identity collision")));
223
+ });
224
+
225
+ test("requires canonical references to be own properties", () => {
226
+ const inherited = Object.create(unit().canonical_refs);
227
+ const value = unit();
228
+ value.canonical_refs = inherited;
229
+ assert(errorsFor([value]).some((error) => error.includes("missing required field")));
230
+ });
231
+
232
+ test("rejects aliases for one semantic tuple", () => {
233
+ const first = unit();
234
+ const refs = { ...first.canonical_refs, surface: "src/alias.ts#updateUser" };
235
+ const alias = unit({ canonical_refs: refs });
236
+ const ledger = [first, alias].sort((left, right) => left.coverage_id.localeCompare(right.coverage_id));
237
+ assert(errorsFor(ledger).some((error) => error.includes("semantic tuple already uses coverage ID")));
238
+ });
239
+
240
+ test("requires lexicographic order", () => {
241
+ const secondRefs = {
242
+ surface: "zzz",
243
+ boundary: "src/authz.ts#requireOwner",
244
+ subsystem: "packages/api",
245
+ attack_class: "ATTACK-CLASSES.md#Access control",
246
+ };
247
+ assert(errorsFor([unit({ canonical_refs: secondRefs }), unit()])
248
+ .some((error) => error.includes("sorted lexicographically")));
249
+ });
250
+
251
+ test("validates assignment block maps", () => {
252
+ const overlap = unit({
253
+ selected_companion_blocks: ["AI-AND-LLM.md#Tool calls"],
254
+ excluded_blocks: [{ block: "AI-AND-LLM.md#Tool calls", reason: "Claimed irrelevant." }],
255
+ });
256
+ assert(errorsFor([overlap]).some((error) => error.includes("also selected")));
257
+
258
+ const noReason = unit({ excluded_blocks: [{ block: "AI-AND-LLM.md#Tool calls", reason: "" }] });
259
+ assert(errorsFor([noReason]).some((error) => error.includes("reason")));
260
+ });
261
+
262
+ test("requires owned artifacts for local checks and null artifacts for source checks", () => {
263
+ const local = unit({
264
+ status: "covered",
265
+ agent_id: "hunter-1",
266
+ reviewed_paths: ["src/router.ts"],
267
+ local_checks: [localCheck()],
268
+ });
269
+ assert.deepEqual(errorsFor([local]), []);
270
+
271
+ const independentlyVerified = unit({
272
+ status: "covered",
273
+ agent_id: "hunter-1",
274
+ reviewed_paths: ["src/router.ts", "src/authz.ts"],
275
+ local_checks: [sourceCheck(), localCheck("verifier-1", { reviewed_paths: ["src/authz.ts"] })],
276
+ });
277
+ assert.deepEqual(errorsFor([independentlyVerified]), []);
278
+
279
+ const unownedPath = unit({
280
+ status: "covered",
281
+ agent_id: "hunter-1",
282
+ reviewed_paths: ["src/router.ts", "src/authz.ts"],
283
+ local_checks: [sourceCheck()],
284
+ });
285
+ assert(errorsFor([unownedPath]).some((error) => error.includes("has no check owner")));
286
+
287
+ for (const [checkAgentId, artifact] of [
288
+ [null, "agents/hunter-1/artifacts/result.txt"],
289
+ ["hunter-1", null],
290
+ ["hunter-1", "result.txt"],
291
+ ["hunter-1", "agents/hunter-2/artifacts/result.txt"],
292
+ ["../hunter", "agents/../hunter/artifacts/result.txt"],
293
+ ]) {
294
+ const value = unit({
295
+ status: "covered",
296
+ agent_id: "hunter-1",
297
+ reviewed_paths: ["src/router.ts"],
298
+ local_checks: [localCheck(checkAgentId, { artifact })],
299
+ });
300
+ assert.notEqual(errorsFor([value]).length, 0, `${checkAgentId}: ${artifact}`);
301
+ }
302
+
303
+ const unownedSource = unit({
304
+ status: "blocked",
305
+ reviewed_paths: ["src/router.ts"],
306
+ local_checks: [sourceCheck()],
307
+ unresolved: ["The boundary behavior is not source-visible."],
308
+ });
309
+ assert(errorsFor([unownedSource]).some((error) => error.includes("unit with status \"blocked\" requires a canonical lowercase agent ID")));
310
+
311
+ const sourceWithArtifact = unit({
312
+ status: "covered",
313
+ agent_id: "hunter-1",
314
+ reviewed_paths: ["src/router.ts"],
315
+ local_checks: [sourceCheck("hunter-1", { artifact: "agents/hunter-1/artifacts/source.txt" })],
316
+ });
317
+ assert(errorsFor([sourceWithArtifact]).some((error) => error.includes("source-only check must use null")));
318
+ });
319
+
320
+ test("requires canonical lowercase filesystem-safe agent IDs", () => {
321
+ for (const value of ["hunter-1", "verifier_2", "a0"]) assert.equal(isSafeAgentId(value), true, value);
322
+ for (const value of ["Hunter-1", "hunter.1", "hunter-1.", "hunter ", "con", "prn", "aux", "nul", "com1", "lpt9", "../hunter"]) {
323
+ assert.equal(isSafeAgentId(value), false, value);
324
+ }
325
+
326
+ const caseAlias = unit({ status: "in_progress", agent_id: "Hunter-1" });
327
+ assert(errorsFor([caseAlias]).some((error) => error.includes("canonical lowercase agent ID")));
328
+ });
329
+
330
+ test("enforces state evidence", () => {
331
+ assert(errorsFor([unit({ status: "in_progress" })]).some((error) => error.includes("unit with status \"in_progress\" requires")));
332
+ assert(errorsFor([unit({ status: "blocked" })]).some((error) => error.includes("unresolved")));
333
+ assert(errorsFor([unit({ status: "candidate" })]).some((error) => error.includes("reviewed_paths")));
334
+
335
+ assert.deepEqual(errorsFor([unit({ status: "in_progress", agent_id: "hunter-1" })]), []);
336
+ const inProgressEvidence = unit({
337
+ status: "in_progress",
338
+ agent_id: "hunter-1",
339
+ reviewed_paths: ["src/router.ts"],
340
+ local_checks: [sourceCheck()],
341
+ });
342
+ assert(errorsFor([inProgressEvidence]).some((error) => error.includes("must keep this array empty")));
343
+
344
+ const assignedPlanned = unit({
345
+ agent_id: "hunter-1",
346
+ reviewed_paths: ["src/router.ts"],
347
+ local_checks: [sourceCheck()],
348
+ });
349
+ assert(errorsFor([assignedPlanned]).some((error) => error.includes("planned unit must be unassigned")));
350
+
351
+ const candidate = unit({
352
+ status: "candidate",
353
+ agent_id: "hunter-1",
354
+ reviewed_paths: ["src/router.ts"],
355
+ local_checks: [sourceCheck("hunter-1", { invariant: "Ownership is required.", result: "No check exists." })],
356
+ result_fingerprints: ["src-router-missing-owner-check"],
357
+ unresolved: ["validation_budget_exhausted"],
358
+ });
359
+ assert.deepEqual(errorsFor([candidate]), []);
360
+
361
+ const blocked = unit({
362
+ status: "blocked",
363
+ agent_id: "hunter-1",
364
+ reviewed_paths: ["src/router.ts"],
365
+ local_checks: [sourceCheck()],
366
+ unresolved: ["The deployed policy is unavailable."],
367
+ });
368
+ assert.deepEqual(errorsFor([blocked]), []);
369
+ const blockedFingerprint = { ...blocked, result_fingerprints: ["forbidden-fingerprint"] };
370
+ assert(errorsFor([blockedFingerprint]).some((error) => error.includes("result_fingerprints")));
371
+
372
+ for (const status of ["not_applicable", "out_of_scope", "deferred"]) {
373
+ assert.deepEqual(errorsFor([unit({ status, unresolved: ["Reason recorded."] })]), []);
374
+ const invalid = unit({
375
+ status,
376
+ agent_id: "hunter-1",
377
+ reviewed_paths: ["src/router.ts"],
378
+ local_checks: [sourceCheck()],
379
+ result_fingerprints: ["forbidden-fingerprint"],
380
+ unresolved: ["Reason recorded."],
381
+ });
382
+ const errors = errorsFor([invalid]);
383
+ assert(errors.some((error) => error.includes("must be unassigned")), status);
384
+ assert(errors.some((error) => error.includes("reviewed_paths")), status);
385
+ assert(errors.some((error) => error.includes("result_fingerprints")), status);
386
+ }
387
+
388
+ const coveredFingerprint = unit({
389
+ status: "covered",
390
+ agent_id: "hunter-1",
391
+ reviewed_paths: ["src/router.ts"],
392
+ local_checks: [sourceCheck()],
393
+ result_fingerprints: ["forbidden-fingerprint"],
394
+ });
395
+ assert(errorsFor([coveredFingerprint]).some((error) => error.includes("result_fingerprints")));
396
+
397
+ const coveredUnresolved = unit({
398
+ status: "covered",
399
+ agent_id: "hunter-1",
400
+ reviewed_paths: ["src/router.ts"],
401
+ local_checks: [sourceCheck()],
402
+ unresolved: ["Unexpected unresolved claim."],
403
+ });
404
+ assert(errorsFor([coveredUnresolved]).some((error) => error.includes("unresolved")));
405
+ });
406
+
407
+ test("archives prior evidence when a critic assigns a fresh owner", () => {
408
+ const reassigned = unit({
409
+ attempts: [archivedAttempt()],
410
+ wave: 2,
411
+ status: "in_progress",
412
+ agent_id: "hunter-2",
413
+ });
414
+ assert.deepEqual(errorsFor([reassigned]), []);
415
+
416
+ const finalClosure = unit({
417
+ attempts: [archivedAttempt()],
418
+ wave: 2,
419
+ status: "covered",
420
+ agent_id: "hunter-2",
421
+ reviewed_paths: ["src/authz.ts"],
422
+ local_checks: [sourceCheck("hunter-2", { reviewed_paths: ["src/authz.ts"] })],
423
+ });
424
+ assert.deepEqual(errorsFor([finalClosure]), []);
425
+ });
426
+
427
+ test("preserves candidate provenance when reassignment must be deferred", () => {
428
+ const candidateAttempt = archivedAttempt({
429
+ status: "candidate",
430
+ result_fingerprints: ["src-router-missing-owner-check"],
431
+ unresolved: ["validation_budget_exhausted"],
432
+ });
433
+ const deferred = unit({
434
+ attempts: [candidateAttempt],
435
+ wave: 2,
436
+ status: "deferred",
437
+ unresolved: ["quick_profile_final_critic"],
438
+ });
439
+ assert.deepEqual(errorsFor([deferred]), []);
440
+ });
441
+
442
+ test("rejects reassignment owner reuse and evidence mixing", () => {
443
+ const reusedOwner = unit({
444
+ attempts: [archivedAttempt()],
445
+ wave: 2,
446
+ status: "in_progress",
447
+ agent_id: "hunter-1",
448
+ });
449
+ assert(errorsFor([reusedOwner]).some((error) => error.includes("current assignment owner must be fresh")));
450
+
451
+ const mixedEvidence = unit({
452
+ attempts: [archivedAttempt({ local_checks: [localCheck()] })],
453
+ wave: 2,
454
+ status: "covered",
455
+ agent_id: "hunter-2",
456
+ reviewed_paths: ["src/router.ts"],
457
+ local_checks: [localCheck()],
458
+ });
459
+ const errors = errorsFor([mixedEvidence]);
460
+ assert(errors.some((error) => error.includes("prior assignment owner evidence must remain")));
461
+ assert(errors.some((error) => error.includes("artifact from an archived attempt cannot be reused")));
462
+
463
+ const mixedHistory = unit({
464
+ attempts: [
465
+ archivedAttempt({ local_checks: [localCheck()] }),
466
+ archivedAttempt({
467
+ wave: 2,
468
+ agent_id: "hunter-2",
469
+ local_checks: [localCheck()],
470
+ }),
471
+ ],
472
+ wave: 3,
473
+ status: "in_progress",
474
+ agent_id: "hunter-3",
475
+ });
476
+ const historyErrors = errorsFor([mixedHistory]);
477
+ assert(historyErrors.some((error) => error.includes("prior assignment owner evidence must remain in its earlier attempt")));
478
+ assert(historyErrors.some((error) => error.includes("artifact from an earlier attempt cannot be reused")));
479
+
480
+ const unordered = unit({
481
+ attempts: [archivedAttempt(), archivedAttempt({
482
+ wave: 1,
483
+ agent_id: "hunter-2",
484
+ local_checks: [sourceCheck("hunter-2")],
485
+ })],
486
+ wave: 3,
487
+ status: "in_progress",
488
+ agent_id: "hunter-3",
489
+ });
490
+ assert(errorsFor([unordered]).some((error) => error.includes("strictly increasing")));
491
+ });
492
+
493
+ test("rejects unsafe paths and malformed fingerprints", () => {
494
+ for (const value of [
495
+ "/etc/passwd",
496
+ "../src/file.js",
497
+ "src/../file.js",
498
+ "src/con.txt",
499
+ "src/PRN",
500
+ "src/AUX.c",
501
+ "src/NUL",
502
+ "src/CLOCK$.txt",
503
+ "src/conin$.txt",
504
+ "src/conout$",
505
+ "src/COM1.log",
506
+ "src/lpt9",
507
+ "src/COM\u00b9.log",
508
+ "src/COM\u00b2.log",
509
+ "src/COM\u00b3.log",
510
+ "src/lpt\u00b9",
511
+ "src/lpt\u00b2",
512
+ "src/lpt\u00b3",
513
+ "src/file.js.",
514
+ "C:/src/file.js",
515
+ "src/file\n.js",
516
+ "src/file\u0085.js",
517
+ "src/file\u2028.js",
518
+ "src/file\u200b.js",
519
+ "src/file\u034f.js",
520
+ "src/file\ufe0f.js",
521
+ ]) {
522
+ assert.equal(isSafeRelativePath(value), false, value);
523
+ }
524
+ assert.equal(isSafeRelativePath("src/handler.js"), true);
525
+ assert.equal(isSafeRelativePath("src/caf\u00e9/handler.js"), true);
526
+ assert(errorsFor([unit({ starting_paths: ["../src/router.ts"] })]).some((error) => error.includes("repository-relative path")));
527
+ assert(errorsFor([unit({
528
+ status: "candidate",
529
+ agent_id: "hunter-1",
530
+ reviewed_paths: ["src/router.ts"],
531
+ local_checks: [sourceCheck("hunter-1", { invariant: "Ownership is required.", result: "No check exists." })],
532
+ result_fingerprints: ["not stable"],
533
+ })]).some((error) => error.includes("invalid fingerprint")));
534
+ });
535
+
536
+ test("rejects format, default-ignorable, and invalid-scalar prose", () => {
537
+ for (const invisible of ["\u200b", "\u034f", "\ufe0f", "\ud800"]) {
538
+ assert(errorsFor([unit({ surface: invisible })]).some((error) => error.includes("surface")), JSON.stringify(invisible));
539
+ assert(errorsFor([unit({
540
+ excluded_blocks: [{ block: "ATTACK-CLASSES.md#Access control", reason: invisible }],
541
+ })]).some((error) => error.includes("reason")), JSON.stringify(invisible));
542
+ }
543
+ });
544
+
545
+ test("quotes input-derived controls in direct validation errors", () => {
546
+ const invalidStatus = `invalid-${TERMINAL_CONTROL_PAYLOAD}`;
547
+ const invalidPath = `src/${TERMINAL_CONTROL_PAYLOAD}.js`;
548
+ const value = unit({
549
+ status: invalidStatus,
550
+ agent_id: "hunter-1",
551
+ reviewed_paths: [invalidPath],
552
+ local_checks: [sourceCheck()],
553
+ result_fingerprints: ["force-state-error"],
554
+ });
555
+ const output = errorsFor([value]).join("\n");
556
+
557
+ assert.match(output, /\$\[0\]\.status/);
558
+ assert.match(output, /\$\[0\]\.reviewed_paths/);
559
+ assert.match(output, /\\u001b/);
560
+ assert.match(output, /\\u0007/);
561
+ assert.match(output, /\\u0085/);
562
+ assert.match(output, /\\u202e/);
563
+ assertNoInjectedControlBytes(output);
564
+ });
565
+
566
+ test("quotes input-derived controls in CLI validation errors", { skip: !HAS_SAFE_INPUT_OPEN }, () => {
567
+ const value = unit({
568
+ status: `invalid-${TERMINAL_CONTROL_PAYLOAD}`,
569
+ result_fingerprints: ["force-state-error"],
570
+ });
571
+ const result = runCli(JSON.stringify([value]));
572
+
573
+ assert.equal(result.status, 1, cliOutput(result));
574
+ assert.match(result.stderr, /\$\[0\]\.status/);
575
+ assert.match(result.stderr, /\\u001b/);
576
+ assertNoInjectedControlBytes(result.stderr);
577
+ });
578
+
579
+ test("returns a generic syntax error without parser-supplied controls", { skip: !HAS_SAFE_INPUT_OPEN }, () => {
580
+ const malformed = Buffer.concat([
581
+ Buffer.from("["),
582
+ Buffer.from(TERMINAL_CONTROL_PAYLOAD),
583
+ Buffer.from("]"),
584
+ ]);
585
+ const result = runCli(malformed);
586
+
587
+ assert.equal(result.status, 1, cliOutput(result));
588
+ assert.equal(result.stderr, "Failed to parse coverage ledger: invalid JSON syntax\n");
589
+ assertNoInjectedControlBytes(result.stderr);
590
+ });
591
+
592
+ test("does not reflect controls from a failed CLI input path", () => {
593
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), "validate-coverage-ledger-path-"));
594
+ const missingPath = path.join(directory, `missing-${TERMINAL_CONTROL_PAYLOAD}.json`);
595
+ try {
596
+ const result = spawnSync(process.execPath, [validatorPath, missingPath], {
597
+ encoding: "utf8",
598
+ timeout: CLI_TIMEOUT_MS,
599
+ });
600
+ assert.equal(result.status, 1, cliOutput(result));
601
+ assert.match(result.stderr, /Failed to read coverage ledger:/);
602
+ assertNoInjectedControlBytes(result.stderr);
603
+ } finally {
604
+ fs.rmSync(directory, { recursive: true, force: true });
605
+ }
606
+ });
607
+
608
+ test("rejects invalid UTF-8 through the CLI", { skip: !HAS_SAFE_INPUT_OPEN }, () => {
609
+ const encoded = Buffer.from(JSON.stringify([unit()]));
610
+ const marker = Buffer.from("Update-user route");
611
+ const markerOffset = encoded.indexOf(marker);
612
+ assert.notEqual(markerOffset, -1);
613
+ const malformed = Buffer.concat([
614
+ encoded.subarray(0, markerOffset),
615
+ Buffer.from([0x80]),
616
+ encoded.subarray(markerOffset + marker.length),
617
+ ]);
618
+
619
+ const result = runCli(malformed);
620
+ const output = cliOutput(result);
621
+ assert.equal(result.status, 1, output);
622
+ assert.match(output, /input is not valid UTF-8/);
623
+ assert.doesNotMatch(output, /TypeError|stack|at validate-coverage-ledger/i);
624
+ });
625
+
626
+ test("rejects a FIFO through the CLI without blocking", { skip: process.platform === "win32" || !HAS_SAFE_INPUT_OPEN }, () => {
627
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), "validate-coverage-ledger-fifo-"));
628
+ const fifoPath = path.join(directory, "coverage-ledger.json");
629
+ try {
630
+ const created = spawnSync("mkfifo", [fifoPath], { encoding: "utf8", timeout: CLI_TIMEOUT_MS });
631
+ assert.equal(created.status, 0, cliOutput(created));
632
+
633
+ const result = spawnSync(process.execPath, [validatorPath, fifoPath], {
634
+ encoding: "utf8",
635
+ timeout: CLI_TIMEOUT_MS,
636
+ });
637
+ const output = cliOutput(result);
638
+ assert.notEqual(result.error && result.error.code, "ETIMEDOUT", output);
639
+ assert.equal(result.status, 1, output);
640
+ assert.match(output, /input must be a regular file/);
641
+ assert.doesNotMatch(output, /stack|at validate-coverage-ledger/i);
642
+ } finally {
643
+ fs.rmSync(directory, { recursive: true, force: true });
644
+ }
645
+ });
646
+
647
+ test("rejects a symlink through the CLI", { skip: process.platform === "win32" || !HAS_SAFE_INPUT_OPEN }, () => {
648
+ const directory = fs.mkdtempSync(path.join(os.tmpdir(), "validate-coverage-ledger-symlink-"));
649
+ const targetPath = path.join(directory, "target.json");
650
+ const symlinkPath = path.join(directory, "coverage-ledger.json");
651
+ try {
652
+ fs.writeFileSync(targetPath, JSON.stringify([unit()]));
653
+ fs.symlinkSync(targetPath, symlinkPath);
654
+ const result = spawnSync(process.execPath, [validatorPath, symlinkPath], {
655
+ encoding: "utf8",
656
+ timeout: CLI_TIMEOUT_MS,
657
+ });
658
+ const output = cliOutput(result);
659
+ assert.notEqual(result.error && result.error.code, "ETIMEDOUT", output);
660
+ assert.equal(result.status, 1, output);
661
+ assert.match(output, /input must not be a symlink/);
662
+ assert.doesNotMatch(output, /stack|at validate-coverage-ledger/i);
663
+ } finally {
664
+ fs.rmSync(directory, { recursive: true, force: true });
665
+ }
666
+ });
667
+
668
+ test("rejects deeply nested input without recursion failure", () => {
669
+ let nested = 0;
670
+ for (let depth = 0; depth < 20000; depth++) nested = [nested];
671
+ assert(errorsFor(nested).some((error) => error.includes("exceeds nesting depth limit 64")));
672
+ if (!HAS_SAFE_INPUT_OPEN) return;
673
+
674
+ const result = runCli(`${"[".repeat(20000)}0${"]".repeat(20000)}`);
675
+ const output = cliOutput(result);
676
+ assert.notEqual(result.error && result.error.code, "ETIMEDOUT", output);
677
+ assert.equal(result.status, 1, output);
678
+ assert.match(output, /exceeds nesting depth limit 64/);
679
+ assert.doesNotMatch(output, /RangeError|Maximum call stack|stack|at validate-coverage-ledger/i);
680
+ });
681
+
682
+ test("rejects multi-megabyte nesting under a constrained Node heap", { skip: !HAS_SAFE_INPUT_OPEN }, () => {
683
+ const openContainers = "[".repeat(2000000);
684
+ const cases = [
685
+ openContainers,
686
+ `${openContainers}0${"]".repeat(2000000)}`,
687
+ ];
688
+ for (const contents of cases) {
689
+ const result = runCli(contents, {
690
+ nodeArgs: ["--max-old-space-size=64"],
691
+ timeout: HOSTILE_CLI_TIMEOUT_MS,
692
+ });
693
+ const output = cliOutput(result);
694
+ assert.notEqual(result.error && result.error.code, "ETIMEDOUT", output);
695
+ assert.equal(result.status, 1, output);
696
+ assert.match(output, /exceeds nesting depth limit 64/);
697
+ assert.doesNotMatch(output, /heap out of memory|allocation failed|RangeError|Maximum call stack|stack|at validate-coverage-ledger/i);
698
+ }
699
+ });
700
+
701
+ test("caps malformed 10000-unit validation output", () => {
702
+ assert.equal(errorsFor(Array.from({ length: LIMITS.units }, () => null)).length, LIMITS.validationErrors);
703
+ if (!HAS_SAFE_INPUT_OPEN) return;
704
+
705
+ const result = runCli(JSON.stringify(Array.from({ length: LIMITS.units }, () => null)));
706
+ const output = cliOutput(result);
707
+ assert.notEqual(result.error && result.error.code, "ETIMEDOUT", output);
708
+ assert.equal(result.status, 1, output);
709
+ assert.match(output, /output capped at 100/);
710
+ assert(output.length < 20000, `unexpected output length ${output.length}`);
711
+ assert.doesNotMatch(output, /RangeError|Maximum call stack|stack|at validate-coverage-ledger/i);
712
+ });
713
+
714
+ test("rejects malformed top-level data and excessive unit counts", () => {
715
+ assert.deepEqual(errorsFor({ units: [] }), ["$: expected a top-level array"]);
716
+ const tooMany = Array.from({ length: 10001 }, () => null);
717
+ const errors = errorsFor(tooMany);
718
+ assert.deepEqual(errors, ["$: exceeds 10000 coverage units"]);
719
+
720
+ const oversizedCollection = unit({ extra: Array.from({ length: LIMITS.collectionItems + 1 }, () => null) });
721
+ assert(errorsFor([oversizedCollection]).some((error) => error.includes("exceeds 1000 entries")));
722
+ });
723
+
724
+ test("accepts a canonical ID derived from near-maximum multibyte references", () => {
725
+ const canonicalRefs = {
726
+ surface: "\u6f22".repeat(1024),
727
+ boundary: "\u00e9".repeat(1024),
728
+ subsystem: "packages/api",
729
+ attack_class: "\u6f22".repeat(1023) + "\u00e9",
730
+ };
731
+ const value = unit({ canonical_refs: canonicalRefs });
732
+ assert(value.coverage_id.length > 16384, `coverage_id length ${value.coverage_id.length}`);
733
+ assert(value.coverage_id.length <= 65536, `coverage_id length ${value.coverage_id.length}`);
734
+ assert.deepEqual(errorsFor([value]), []);
735
+
736
+ if (HAS_SAFE_INPUT_OPEN) {
737
+ const result = runCli(JSON.stringify([value]));
738
+ assert.equal(result.status, 0, cliOutput(result));
739
+ }
740
+ });