@qijenchen/governance 0.1.0-beta.94

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 (40) hide show
  1. package/README.md +89 -0
  2. package/bin/attest.mjs +4 -0
  3. package/bin/check.mjs +4 -0
  4. package/bin/doctor.mjs +4 -0
  5. package/bin/generate.mjs +4 -0
  6. package/bin/governance.mjs +4 -0
  7. package/bin/hook.mjs +4 -0
  8. package/bin/upgrade.mjs +4 -0
  9. package/canonical/gates.json +42 -0
  10. package/canonical/manifest.json +476 -0
  11. package/canonical/plugin-aliases.json +25 -0
  12. package/canonical/provider-lifecycle.json +48 -0
  13. package/canonical/providers.json +455 -0
  14. package/canonical/roles.json +12 -0
  15. package/canonical/rules.json +81 -0
  16. package/canonical/schemas/attestation.schema.json +61 -0
  17. package/canonical/schemas/diagnostic.schema.json +37 -0
  18. package/canonical/schemas/gates.schema.json +27 -0
  19. package/canonical/schemas/lock.schema.json +189 -0
  20. package/canonical/schemas/manifest.schema.json +103 -0
  21. package/canonical/schemas/plugin-aliases.schema.json +59 -0
  22. package/canonical/schemas/provider-hook-coverage.schema.json +173 -0
  23. package/canonical/schemas/provider-lifecycle.schema.json +126 -0
  24. package/canonical/schemas/providers.schema.json +917 -0
  25. package/canonical/schemas/roles.schema.json +27 -0
  26. package/canonical/schemas/rules.schema.json +46 -0
  27. package/canonical/schemas/upgrade-plan.schema.json +31 -0
  28. package/package.json +42 -0
  29. package/src/authority-decision-evidence.mjs +413 -0
  30. package/src/canonical-order.mjs +8 -0
  31. package/src/carrier-projection.mjs +407 -0
  32. package/src/cli.mjs +114 -0
  33. package/src/closed-tool-execution.mjs +1001 -0
  34. package/src/common.mjs +278 -0
  35. package/src/contract.mjs +760 -0
  36. package/src/hook-api.mjs +107 -0
  37. package/src/index.mjs +14 -0
  38. package/src/provider-hook-normalization.mjs +1646 -0
  39. package/src/provider-review-binding.mjs +2377 -0
  40. package/src/snapshot.mjs +520 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "./schemas/plugin-aliases.schema.json",
3
+ "schemaVersion": 1,
4
+ "providerId": "claude",
5
+ "aliases": [
6
+ {
7
+ "id": "commands",
8
+ "alias": "commands",
9
+ "source": { "kind": "repositoryManagedTree", "key": "commands" },
10
+ "requiredEntries": ["README.md"]
11
+ },
12
+ {
13
+ "id": "hooks-scripts",
14
+ "alias": "hooks/scripts",
15
+ "source": { "kind": "repositoryManagedTree", "key": "hooks" },
16
+ "requiredEntries": ["README.md"]
17
+ },
18
+ {
19
+ "id": "skills",
20
+ "alias": "skills",
21
+ "source": { "kind": "skillView" },
22
+ "requiredEntries": ["README.md"]
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "./schemas/provider-lifecycle.schema.json",
3
+ "schemaVersion": 1,
4
+ "kind": "provider-lifecycle-ledger",
5
+ "immutableHead": {
6
+ "releaseVersion": "0.1.0-beta.95",
7
+ "snapshotSha256": "1095b06a56c48912b3ac1678eb5a94c75199a22f40212db4822be9834495ee7e",
8
+ "providerInventorySha256": "86e9d0668cb54ad1bf05c36e78b4aa80417d5f468c929dd3ddcf69c1afbf32e4"
9
+ },
10
+ "snapshots": [
11
+ {
12
+ "releaseVersion": "0.1.0-beta.95",
13
+ "previousSnapshotSha256": null,
14
+ "providers": [
15
+ {
16
+ "id": "claude",
17
+ "discovery": {
18
+ "providerRootNames": [".claude"],
19
+ "instructionNames": ["CLAUDE.md"],
20
+ "instructionOverrideNames": ["CLAUDE.local.md", "CLAUDE.override.md"],
21
+ "configPaths": [".claude/settings.json", ".claude/settings.local.json", ".mcp.json"],
22
+ "pluginRootNames": [".claude-plugin"]
23
+ },
24
+ "surfaces": [
25
+ { "path": ".claude/settings.json", "kind": "file" },
26
+ { "path": ".claude/skills", "kind": "tree" },
27
+ { "path": "CLAUDE.md", "kind": "file" }
28
+ ]
29
+ },
30
+ {
31
+ "id": "codex",
32
+ "discovery": {
33
+ "providerRootNames": [".agents", ".codex"],
34
+ "instructionNames": ["AGENTS.md"],
35
+ "instructionOverrideNames": ["AGENTS.local.md", "AGENTS.override.md"],
36
+ "configPaths": [".codex/config.toml", ".codex/hooks.json"],
37
+ "pluginRootNames": [".codex-plugin"]
38
+ },
39
+ "surfaces": [
40
+ { "path": ".agents/skills", "kind": "tree" },
41
+ { "path": ".codex/hooks.json", "kind": "file" }
42
+ ]
43
+ }
44
+ ],
45
+ "retiredProviders": []
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,455 @@
1
+ {
2
+ "$schema": "./schemas/providers.schema.json",
3
+ "schemaVersion": 9,
4
+ "canonical": {
5
+ "roots": {
6
+ "contextForkAgents": "packages/design-system/ds-canonical/adapters/claude/agents",
7
+ "commands": "packages/design-system/ds-canonical/commands",
8
+ "hooks": "packages/design-system/ds-canonical/hooks",
9
+ "references": "packages/design-system/ds-canonical/references",
10
+ "rules": "packages/design-system/ds-canonical/rules",
11
+ "skills": "packages/design-system/ds-canonical/skills"
12
+ },
13
+ "hookRegistrations": "packages/design-system/ds-canonical/hooks/registrations.json",
14
+ "skillSemantics": "scripts/provider-skill-semantics.json",
15
+ "productSharedInstructionSource": "scripts/fork-role-sources/AGENTS.product.md",
16
+ "reviewSelectionPolicies": {
17
+ "highest-certified-independent-review-v1": {
18
+ "schemaVersion": 1,
19
+ "assuranceTierOrder": ["standard", "high", "maximum"],
20
+ "reasoningTierOrder": ["standard", "high", "maximum"],
21
+ "computeTierOrder": ["standard", "high", "maximum"],
22
+ "reviewClasses": {
23
+ "tier-0-governance": {
24
+ "assuranceTier": "maximum",
25
+ "reasoningTier": "maximum",
26
+ "computeTier": "maximum"
27
+ }
28
+ },
29
+ "eligibility": {
30
+ "independentProvider": true,
31
+ "independentContext": true,
32
+ "immutableTarget": true,
33
+ "identicalEvidence": true,
34
+ "completeEvidenceVisibility": true,
35
+ "certifiedCapability": true,
36
+ "policyAllowed": true,
37
+ "noSelfReview": true,
38
+ "failClosed": true
39
+ },
40
+ "ranking": [
41
+ "assurance-tier-desc",
42
+ "reasoning-tier-desc",
43
+ "compute-tier-desc",
44
+ "available-required-entitlement-route-first",
45
+ "provider-local-capability-rank-desc",
46
+ "provider-id-utf8-asc",
47
+ "review-profile-id-utf8-asc",
48
+ "model-release-id-utf8-asc"
49
+ ],
50
+ "costPolicy": "batch-or-stop-never-capability-downgrade",
51
+ "bindingPolicy": "freeze-exact-provider-profile-model-and-registry-digests-after-selection",
52
+ "unavailableOutcome": "REVIEW-BLOCKED"
53
+ }
54
+ },
55
+ "materializers": {
56
+ "instructionViews": {
57
+ "markdown-relative-at-import-v1": {
58
+ "engine": "markdown-relative-at-import-v1",
59
+ "ownershipPolicy": "provider-generated-projection",
60
+ "supplementPolicy": "optional"
61
+ },
62
+ "shared-instruction-v1": {
63
+ "engine": "shared-instruction-v1",
64
+ "ownershipPolicy": "common-authority-consumer",
65
+ "supplementPolicy": "forbidden"
66
+ }
67
+ },
68
+ "hookBaseTemplateContracts": {
69
+ "claude-permission-policy-v1": {
70
+ "engine": "claude-permission-policy-v1",
71
+ "source": "packages/design-system/ds-canonical/adapters/claude-settings-base.json",
72
+ "schema": "scripts/schemas/claude-permission-policy.schema.json"
73
+ },
74
+ "static-json-object-v1": {
75
+ "engine": "static-json-object-v1"
76
+ }
77
+ },
78
+ "hookViews": {
79
+ "claude-settings-json-v1": {
80
+ "engine": "json-hook-map-v1",
81
+ "hooksField": "hooks",
82
+ "descriptionField": null,
83
+ "mergeStrategy": "merge-hook-map-into-base-v1",
84
+ "baseTemplateContract": "claude-permission-policy-v1"
85
+ },
86
+ "command-hooks-json-v1": {
87
+ "engine": "json-hook-map-v1",
88
+ "hooksField": "hooks",
89
+ "descriptionField": "description",
90
+ "mergeStrategy": "replace-document-v1",
91
+ "baseTemplateContract": null
92
+ },
93
+ "portable-event-list-json-v1": {
94
+ "engine": "json-hook-event-list-v1",
95
+ "eventsField": "events",
96
+ "eventField": "event",
97
+ "groupsField": "groups",
98
+ "matcherField": "when",
99
+ "handlersField": "handlers",
100
+ "handlerArgvField": "argv",
101
+ "descriptionField": "description",
102
+ "mergeStrategy": "replace-document-v1",
103
+ "baseTemplateContract": null
104
+ }
105
+ },
106
+ "skillViews": {
107
+ "agent-skills-directory-v1": {
108
+ "engine": "skill-directory-v1",
109
+ "entryFile": "SKILL.md"
110
+ },
111
+ "markdown-workflows-directory-v1": {
112
+ "engine": "skill-directory-v1",
113
+ "entryFile": "WORKFLOW.md"
114
+ }
115
+ },
116
+ "treeViews": {
117
+ "closed-tree-copy-v1": {
118
+ "engine": "closed-tree-copy-v1",
119
+ "transformPolicies": ["byte-exact"]
120
+ }
121
+ }
122
+ },
123
+ "compatibilityProjections": {
124
+ "legacyClaudeInstruction": {
125
+ "schemaVersion": 1,
126
+ "providerId": "claude",
127
+ "discoveryCategories": [
128
+ {
129
+ "name": "agents",
130
+ "sourceRoot": "packages/design-system/ds-canonical/adapters/claude/agents",
131
+ "artifactRoot": "agents",
132
+ "destinationRoot": ".claude/agents",
133
+ "entries": []
134
+ },
135
+ {
136
+ "name": "commands",
137
+ "sourceRoot": "packages/design-system/ds-canonical/commands",
138
+ "artifactRoot": "commands",
139
+ "destinationRoot": ".claude/commands",
140
+ "entries": []
141
+ }
142
+ ],
143
+ "legacyProductTreeTombstones": [".claude/hooks"]
144
+ },
145
+ "legacyCodexCorpus": {
146
+ "schemaVersion": 1,
147
+ "providerId": "codex",
148
+ "hookArtifact": "codex/hooks.json",
149
+ "skillArtifactRoot": "codex/agents/skills"
150
+ },
151
+ "marketplacePluginTransport": {
152
+ "schemaVersion": 2,
153
+ "profileId": "claude-authority-full",
154
+ "pluginFullId": "design-system@qijenchen-ds",
155
+ "providerId": "claude",
156
+ "hookOutput": "hooks/hooks.json",
157
+ "aliasRegistry": "packages/governance/canonical/plugin-aliases.json",
158
+ "repositoryRole": "authority",
159
+ "governanceRole": "ds-author",
160
+ "projection": "full-canonical-registrations",
161
+ "targetRoleManifest": "packages/governance/canonical/manifest.json"
162
+ }
163
+ },
164
+ "reservedDiscovery": {
165
+ "providerRootNames": [".agents", ".claude", ".codex"],
166
+ "instructionNames": ["AGENTS.md", "CLAUDE.md"],
167
+ "instructionOverrideNames": ["AGENTS.local.md", "AGENTS.override.md", "CLAUDE.local.md", "CLAUDE.override.md"],
168
+ "configPaths": [".claude/settings.json", ".claude/settings.local.json", ".codex/config.toml", ".codex/hooks.json", ".mcp.json"],
169
+ "pluginRootNames": [".claude-plugin", ".codex-plugin"]
170
+ },
171
+ "retiredProviders": []
172
+ },
173
+ "providers": [
174
+ {
175
+ "id": "claude",
176
+ "displayName": "Claude Code",
177
+ "providerKind": "concrete-runtime",
178
+ "instructionEntry": "CLAUDE.md",
179
+ "sharedInstructionEntry": "AGENTS.md",
180
+ "skillDirectory": ".claude/skills",
181
+ "hookConfig": ".claude/settings.json",
182
+ "hookConfigFormat": "json",
183
+ "hookEntrypoint": "scripts/run-provider-hook.mjs",
184
+ "blockingExitCode": 2,
185
+ "capabilities": { "nativeHooks": true, "hookTrustRequired": false, "hardGateComplete": false, "hookEnforcement": "native-feedback-plus-ci" },
186
+ "runtime": {
187
+ "cli": {
188
+ "executable": "claude",
189
+ "localExecutable": "node_modules/.bin/claude",
190
+ "briefInvocationMarkers": ["-p", "--print"],
191
+ "discoveryMarkers": ["node_modules/.bin/claude", "command -v claude", "which claude"],
192
+ "replyArtifactPrefix": "claude-reply"
193
+ },
194
+ "transcript": {
195
+ "contract": "claude-transcript-jsonl-v2",
196
+ "stability": "tested-versioned",
197
+ "fixture": "packages/design-system/ds-canonical/hooks/tests/fixtures/transcripts/claude-transcript-jsonl-v2.jsonl",
198
+ "access": {
199
+ "strategy": "validated-jsonl-tail-v2",
200
+ "pathPolicy": "canonical-unique-regular-file-no-name-assumption",
201
+ "recordFormat": "json-lines",
202
+ "emptyState": "allowed-zero-byte",
203
+ "maximumRetainedRecordCount": 1200,
204
+ "maximumRecordBytes": 4194304,
205
+ "maximumMaterializedBytes": 16777216
206
+ }
207
+ },
208
+ "contextOutputTransport": "claude-hook-specific",
209
+ "stopDecisionTransport": "claude-decision-json",
210
+ "branchNamespace": "claude/",
211
+ "memorySyncScript": "scripts/sync-memory.mjs"
212
+ },
213
+ "normalization": {
214
+ "eventFields": ["hook_event_name", "event"],
215
+ "toolFields": ["tool_name", "tool"],
216
+ "pathFields": ["tool_input.file_path", "tool_input.path", "file_path", "path"],
217
+ "pathArrayFields": ["changed_paths", "tool_input.changed_paths", "changes", "tool_input.changes", "tool_input.edits", "tool_input.files"],
218
+ "writeTools": ["Edit", "Write", "MultiEdit", "apply_patch"],
219
+ "writeTransports": [
220
+ {
221
+ "id": "claude-edit-v1",
222
+ "rawTools": ["Edit"],
223
+ "engine": "exact-replace-v1",
224
+ "payloadFields": ["tool_input.file_path", "tool_input.old_string", "tool_input.new_string", "tool_input.replace_all"]
225
+ },
226
+ {
227
+ "id": "claude-multi-edit-v1",
228
+ "rawTools": ["MultiEdit"],
229
+ "engine": "exact-replace-list-v1",
230
+ "payloadFields": ["tool_input.file_path", "tool_input.edits", "old_string", "new_string", "replace_all"]
231
+ },
232
+ {
233
+ "id": "claude-write-v1",
234
+ "rawTools": ["Write"],
235
+ "engine": "full-file-v1",
236
+ "payloadFields": ["tool_input.file_path", "tool_input.content"]
237
+ }
238
+ ],
239
+ "eventAliases": { "beforewrite": "PreToolUse", "prewrite": "PreToolUse", "pretooluse": "PreToolUse", "afterwrite": "PostToolUse", "postwrite": "PostToolUse", "posttooluse": "PostToolUse", "sessionstart": "SessionStart", "userpromptsubmit": "UserPromptSubmit", "stop": "Stop" },
240
+ "toolAliases": { "apply_patch": "MultiEdit", "patch": "MultiEdit", "multiedit": "MultiEdit", "write_file": "Write", "write": "Write", "create_file": "Write", "edit_file": "Edit", "edit": "Edit", "replace": "Edit", "exec_command": "Bash", "shell_command": "Bash", "bash": "Bash" }
241
+ },
242
+ "adapter": {
243
+ "generate": true,
244
+ "repositoryInstructionSource": "packages/design-system/ds-canonical/adapters/claude-root-instructions.md",
245
+ "instructionView": { "materializerId": "markdown-relative-at-import-v1" },
246
+ "productInstructionSource": "scripts/fork-role-sources/CLAUDE.product.md",
247
+ "repositoryManagedTrees": { "contextForkAgents": ".claude/agents", "commands": ".claude/commands", "hooks": ".claude/hooks", "references": ".claude/references", "rules": ".claude/rules" },
248
+ "productManagedTrees": {},
249
+ "skillView": { "directory": ".claude/skills", "materializerId": "agent-skills-directory-v1" },
250
+ "hookView": {
251
+ "output": ".claude/settings.json",
252
+ "materializerId": "claude-settings-json-v1",
253
+ "settingsTemplate": "packages/design-system/ds-canonical/adapters/claude-settings-base.json",
254
+ "supportedEvents": ["PreToolUse", "PostToolUse", "Stop", "SessionStart", "UserPromptSubmit"],
255
+ "eventBindings": {
256
+ "PreToolUse": "PreToolUse",
257
+ "PostToolUse": "PostToolUse",
258
+ "SessionStart": "SessionStart",
259
+ "Stop": "Stop",
260
+ "UserPromptSubmit": "UserPromptSubmit"
261
+ },
262
+ "matcherAliases": {},
263
+ "workingDirectoryPolicy": "repository-root"
264
+ },
265
+ "environmentMap": {
266
+ "GOVERNANCE_PROJECT_DIR": "CLAUDE_PROJECT_DIR",
267
+ "GOVERNANCE_SESSION_ID": "CLAUDE_SESSION_ID",
268
+ "GOVERNANCE_TRANSCRIPT_PATH": "CLAUDE_TRANSCRIPT_PATH",
269
+ "GOVERNANCE_PLUGIN_ROOT": "CLAUDE_PLUGIN_ROOT",
270
+ "GOVERNANCE_TOOL_INPUT": "CLAUDE_TOOL_INPUT",
271
+ "GOVERNANCE_BYPASS_SOLO_WORKFLOW": "CLAUDE_BYPASS_SOLO_WORKFLOW",
272
+ "GOVERNANCE_BYPASS_DS_ANCHOR": "CLAUDE_BYPASS_DS_ANCHOR",
273
+ "GOVERNANCE_BYPASS_MAIN_WORKBENCH": "CLAUDE_BYPASS_MAIN_WORKBENCH",
274
+ "GOVERNANCE_BYPASS_ESCAPE_MARKER_AUDIT": "CLAUDE_BYPASS_ESCAPE_MARKER_AUDIT",
275
+ "GOVERNANCE_BYPASS_CHROME_HEADER_AVATAR": "CLAUDE_BYPASS_CHROME_HEADER_AVATAR",
276
+ "GOVERNANCE_BYPASS_SIDEBAR_MENU_BUTTON_WRAP": "CLAUDE_BYPASS_SIDEBAR_MENU_BUTTON_WRAP"
277
+ },
278
+ "skillBindings": {
279
+ "codex-collab": { "self": "claude", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "scripts/run-model-deep-audit.mjs", "invocation": { "strategy": "main-context" } },
280
+ "deep-audit-cross-codex": { "self": "claude", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "content-addressed-model-broker-exchange-v1", "invocation": { "strategy": "main-context" }, "certificationContract": "exact-provider-runtime-surface-role-target-v1" },
281
+ "canonical-reviewer": { "self": "claude", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "external-or-orchestrator", "invocation": { "strategy": "native-context-fork", "context": "fork", "agent": "canonical-reviewer" } },
282
+ "independent-review": { "self": "claude", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "content-addressed-model-broker-exchange-v1", "invocation": { "strategy": "main-context" }, "certificationContract": "exact-provider-runtime-surface-role-target-v1" }
283
+ },
284
+ "skillAliases": [],
285
+ "discovery": {
286
+ "providerRootNames": [".claude"],
287
+ "instructionNames": ["CLAUDE.md"],
288
+ "instructionOverrideNames": ["CLAUDE.local.md", "CLAUDE.override.md"],
289
+ "configPaths": [".claude/settings.json", ".claude/settings.local.json", ".mcp.json"],
290
+ "pluginRootNames": [".claude-plugin"]
291
+ }
292
+ }
293
+ },
294
+ {
295
+ "id": "codex",
296
+ "displayName": "Codex",
297
+ "providerKind": "concrete-runtime",
298
+ "instructionEntry": "AGENTS.md",
299
+ "sharedInstructionEntry": "AGENTS.md",
300
+ "skillDirectory": ".agents/skills",
301
+ "hookConfig": ".codex/hooks.json",
302
+ "hookConfigFormat": "json",
303
+ "hookEntrypoint": "scripts/run-provider-hook.mjs",
304
+ "blockingExitCode": 2,
305
+ "capabilities": { "nativeHooks": true, "hookTrustRequired": true, "hardGateComplete": false, "hookEnforcement": "native-feedback-plus-ci" },
306
+ "runtime": {
307
+ "cli": {
308
+ "executable": "codex",
309
+ "localExecutable": "node_modules/.bin/codex",
310
+ "briefInvocationMarkers": ["exec", "review"],
311
+ "discoveryMarkers": ["node_modules/.bin/codex", "command -v codex", "which codex", ".codex/auth.json"],
312
+ "replyArtifactPrefix": "codex-reply"
313
+ },
314
+ "transcript": {
315
+ "contract": null,
316
+ "stability": "unstable-opaque",
317
+ "fixture": null,
318
+ "access": null
319
+ },
320
+ "contextOutputTransport": "system-message",
321
+ "stopDecisionTransport": "continue-json",
322
+ "branchNamespace": "codex/",
323
+ "memorySyncScript": null
324
+ },
325
+ "normalization": {
326
+ "eventFields": ["hook_event_name", "event", "event_name"],
327
+ "toolFields": ["tool_name", "tool", "operation", "action"],
328
+ "pathFields": ["tool_input.file_path", "tool_input.path", "file_path", "path"],
329
+ "pathArrayFields": ["changed_paths", "tool_input.changed_paths", "changes", "tool_input.changes", "tool_input.edits", "tool_input.files"],
330
+ "writeTools": ["apply_patch", "write_file", "edit_file", "Edit", "Write", "MultiEdit"],
331
+ "writeTransports": [
332
+ {
333
+ "id": "codex-apply-patch-v1",
334
+ "rawTools": ["apply_patch"],
335
+ "engine": "codex-apply-patch-v1",
336
+ "payloadFields": ["tool_input.command"]
337
+ }
338
+ ],
339
+ "eventAliases": { "beforewrite": "PreToolUse", "prewrite": "PreToolUse", "pretooluse": "PreToolUse", "afterwrite": "PostToolUse", "postwrite": "PostToolUse", "posttooluse": "PostToolUse", "sessionstart": "SessionStart", "userpromptsubmit": "UserPromptSubmit", "stop": "Stop" },
340
+ "toolAliases": { "apply_patch": "MultiEdit", "patch": "MultiEdit", "multiedit": "MultiEdit", "write_file": "Write", "write": "Write", "create_file": "Write", "edit_file": "Edit", "edit": "Edit", "replace": "Edit", "exec_command": "Bash", "shell_command": "Bash", "bash": "Bash" }
341
+ },
342
+ "adapter": {
343
+ "generate": true,
344
+ "repositoryInstructionSource": null,
345
+ "instructionView": { "materializerId": "shared-instruction-v1" },
346
+ "productInstructionSource": "scripts/fork-role-sources/AGENTS.product.md",
347
+ "repositoryManagedTrees": {},
348
+ "productManagedTrees": {},
349
+ "skillView": { "directory": ".agents/skills", "materializerId": "agent-skills-directory-v1" },
350
+ "hookView": {
351
+ "output": ".codex/hooks.json",
352
+ "materializerId": "command-hooks-json-v1",
353
+ "settingsTemplate": null,
354
+ "supportedEvents": ["PreToolUse", "PostToolUse", "Stop", "SessionStart", "UserPromptSubmit"],
355
+ "eventBindings": {
356
+ "PreToolUse": "PreToolUse",
357
+ "PostToolUse": "PostToolUse",
358
+ "SessionStart": "SessionStart",
359
+ "Stop": "Stop",
360
+ "UserPromptSubmit": "UserPromptSubmit"
361
+ },
362
+ "matcherAliases": {
363
+ "Edit": ["Edit", "edit_file", "apply_patch"],
364
+ "Write": ["Write", "write_file", "apply_patch"],
365
+ "MultiEdit": ["MultiEdit", "apply_patch"],
366
+ "Bash": ["Bash", "exec_command", "shell_command"]
367
+ },
368
+ "workingDirectoryPolicy": "repository-root"
369
+ },
370
+ "environmentMap": {},
371
+ "skillBindings": {
372
+ "codex-collab": { "self": "codex", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "external-or-orchestrator", "invocation": { "strategy": "main-context" } },
373
+ "deep-audit-cross-codex": { "self": "codex", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "content-addressed-model-broker-exchange-v1", "invocation": { "strategy": "main-context" }, "certificationContract": "exact-provider-runtime-surface-role-target-v1" },
374
+ "canonical-reviewer": { "self": "codex", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "external-or-orchestrator", "invocation": { "strategy": "main-context" } },
375
+ "independent-review": { "self": "codex", "selectionPolicy": "highest-certified-independent-review-v1", "reviewClass": "tier-0-governance", "transport": "content-addressed-model-broker-exchange-v1", "invocation": { "strategy": "main-context" }, "certificationContract": "exact-provider-runtime-surface-role-target-v1" }
376
+ },
377
+ "skillAliases": [],
378
+ "discovery": {
379
+ "providerRootNames": [".agents", ".codex"],
380
+ "instructionNames": ["AGENTS.md"],
381
+ "instructionOverrideNames": ["AGENTS.local.md", "AGENTS.override.md"],
382
+ "configPaths": [".codex/config.toml", ".codex/hooks.json"],
383
+ "pluginRootNames": [".codex-plugin"]
384
+ }
385
+ }
386
+ },
387
+ {
388
+ "id": "generic",
389
+ "displayName": "Generic automation",
390
+ "providerKind": "headless-protocol",
391
+ "instructionEntry": "AGENTS.md",
392
+ "sharedInstructionEntry": "AGENTS.md",
393
+ "skillDirectory": ".agents/skills",
394
+ "hookConfig": null,
395
+ "hookConfigFormat": null,
396
+ "hookEntrypoint": null,
397
+ "blockingExitCode": 2,
398
+ "capabilities": { "nativeHooks": false, "hookTrustRequired": false, "hardGateComplete": false, "hookEnforcement": "ci-only" },
399
+ "runtime": null,
400
+ "normalization": {
401
+ "eventFields": ["event"],
402
+ "toolFields": ["operation", "tool"],
403
+ "pathFields": ["path", "file_path"],
404
+ "pathArrayFields": ["paths", "changed_paths"],
405
+ "writeTools": ["write", "edit", "apply_patch"],
406
+ "writeTransports": [
407
+ {
408
+ "id": "generic-edit-v1",
409
+ "rawTools": ["edit"],
410
+ "engine": "exact-replace-v1",
411
+ "payloadFields": ["path", "old_content", "new_content", "replace_all"]
412
+ },
413
+ {
414
+ "id": "generic-unified-diff-v1",
415
+ "rawTools": ["apply_patch"],
416
+ "engine": "unified-diff-v1",
417
+ "payloadFields": ["diff"]
418
+ },
419
+ {
420
+ "id": "generic-write-v1",
421
+ "rawTools": ["write"],
422
+ "engine": "full-file-v1",
423
+ "payloadFields": ["path", "content"]
424
+ }
425
+ ],
426
+ "eventAliases": { "beforewrite": "PreToolUse", "afterwrite": "PostToolUse" },
427
+ "toolAliases": { "write": "Write", "edit": "Edit", "apply_patch": "MultiEdit" }
428
+ },
429
+ "adapter": {
430
+ "generate": false,
431
+ "repositoryInstructionSource": null,
432
+ "instructionView": { "materializerId": "shared-instruction-v1" },
433
+ "productInstructionSource": null,
434
+ "repositoryManagedTrees": {},
435
+ "productManagedTrees": {},
436
+ "skillView": null,
437
+ "hookView": null,
438
+ "environmentMap": {},
439
+ "skillBindings": {},
440
+ "skillAliases": [],
441
+ "discovery": {
442
+ "providerRootNames": [".agents"],
443
+ "instructionNames": ["AGENTS.md"],
444
+ "instructionOverrideNames": ["AGENTS.local.md", "AGENTS.override.md"],
445
+ "configPaths": [],
446
+ "pluginRootNames": []
447
+ },
448
+ "exclusions": [
449
+ { "scope": "native-hooks", "reasonCode": "NATIVE_HOOK_API_UNAVAILABLE", "detail": "This runtime has no declared native hook surface; hook-independent governance checks remain authoritative." },
450
+ { "scope": "provider-skills", "reasonCode": "NO_DISCOVERY_SURFACE_DECLARED", "detail": "This abstract provider has no independent skill discovery surface; a concrete provider must register one before generation." }
451
+ ]
452
+ }
453
+ }
454
+ ]
455
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "./schemas/roles.schema.json",
3
+ "schemaVersion": 1,
4
+ "roles": [
5
+ {
6
+ "id": "ds-author",
7
+ "providerSelection": "all-registered",
8
+ "requiredGateIds": ["snapshot-integrity", "contract-doctor", "provider-parity", "hook-independent-ci", "artifact-attestation", "safe-upgrade"],
9
+ "requiredSourceIds": ["agent-bootstrap", "claude-instruction-adapter", "canonical-hooks", "canonical-rules", "canonical-references", "canonical-skills", "provider-hook-registrations", "provider-hook-registrations-schema", "provider-adapter-generator", "provider-review-binding-library", "product-independent-review-launcher", "provider-hook-runner", "provider-skill-semantics", "provider-skill-semantics-schema", "provider-compatibility-matrix", "provider-role-surface-policy", "provider-role-surface-policy-schema", "provider-role-surface-policy-library", "provider-surface-certifications", "external-operator-library", "external-operator-cli", "external-operator-tests", "external-surface-import-receipt-schema", "external-runtime-certification-proposal-schema", "external-ledger-transaction-handoff-schema", "external-activation-signing-request-schema", "external-activation-signature-bundle-schema", "external-activation-proposal-schema", "external-operator-block-result-schema", "consumer-upgrade-protocol", "consumer-upgrade-protocol-schema", "consumer-upgrade-protocol-library", "governance-runtime-dependency-closure-library", "consumer-control-plane-policy-library", "consumer-control-plane-cli", "consumer-control-plane-tests", "consumer-control-plane-baseline-receipt-schema", "consumer-control-plane-update-plan-schema", "consumer-control-plane-update-snapshot-verification-schema", "consumer-control-plane-update-readback-schema", "consumer-control-plane-update-readback-verification-schema", "consumer-control-plane-update-acceptance-proposal-schema", "consumer-managed-repos-inventory", "consumer-managed-repository-ownership-library", "consumer-bootstrap-library", "consumer-bootstrap-plan-schema", "consumer-bootstrap-snapshot-verification-schema", "consumer-bootstrap-readback-verification-schema", "consumer-bootstrap-promotion-proposal-schema", "consumer-bootstrap-managed-repos-schema", "consumer-fanout-review-schema", "governance-harness-registry", "governance-harness-registry-schema", "governance-harness-registry-library", "governance-harness-source-inventory", "governance-harness-source-inventory-schema", "governance-harness-source-inventory-library", "governance-harness-non-governance-exclusions", "governance-harness-non-governance-exclusions-schema", "governance-harness-runner-library", "governance-playwright-runtime-library", "governance-playwright-runtime-tests", "governance-playwright-setup-cli", "governance-authority-setup-cli", "governance-authority-setup-tests", "governance-harness-runner-cli", "governance-harness-suite-runner-cli", "gate-meta-test-exclusions", "gate-meta-test-inventory-library", "gate-meta-test-runner", "bundle-size-gate", "audit-rubric"]
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "./schemas/rules.schema.json",
3
+ "schemaVersion": 1,
4
+ "rules": [
5
+ {
6
+ "ruleId": "GOV-CONTRACT-001",
7
+ "severity": "critical",
8
+ "source": "packages/governance/README.md#control-plane-invariants",
9
+ "appliesToRoles": ["*"],
10
+ "match": { "kind": "registry-invariant" },
11
+ "blocking": true,
12
+ "providerCoverage": {
13
+ "*": "hard-gate"
14
+ },
15
+ "gateIds": ["contract-doctor"]
16
+ },
17
+ {
18
+ "ruleId": "GOV-GENERATED-001",
19
+ "severity": "critical",
20
+ "source": "packages/governance/README.md#generated-artifacts-are-read-only",
21
+ "appliesToRoles": ["*"],
22
+ "match": {
23
+ "kind": "protected-generated-path",
24
+ "pathTemplate": "{outputDirectory}/**"
25
+ },
26
+ "blocking": true,
27
+ "providerCoverage": {
28
+ "*": "adapter"
29
+ },
30
+ "gateIds": ["snapshot-integrity", "hook-independent-ci"]
31
+ },
32
+ {
33
+ "ruleId": "GOV-SNAPSHOT-001",
34
+ "severity": "critical",
35
+ "source": "packages/governance/README.md#snapshots-are-exact",
36
+ "appliesToRoles": ["*"],
37
+ "match": { "kind": "registry-invariant" },
38
+ "blocking": true,
39
+ "providerCoverage": {
40
+ "*": "hard-gate"
41
+ },
42
+ "gateIds": ["snapshot-integrity", "contract-doctor"]
43
+ },
44
+ {
45
+ "ruleId": "GOV-PROVIDER-001",
46
+ "severity": "critical",
47
+ "source": "packages/governance/README.md#provider-outcomes-are-equivalent",
48
+ "appliesToRoles": ["*"],
49
+ "match": { "kind": "registry-invariant" },
50
+ "blocking": true,
51
+ "providerCoverage": {
52
+ "*": "adapter"
53
+ },
54
+ "gateIds": ["provider-parity", "hook-independent-ci"]
55
+ },
56
+ {
57
+ "ruleId": "GOV-ATTEST-001",
58
+ "severity": "critical",
59
+ "source": "packages/governance/README.md#attestations-are-evidence-bound",
60
+ "appliesToRoles": ["*"],
61
+ "match": { "kind": "registry-invariant" },
62
+ "blocking": true,
63
+ "providerCoverage": {
64
+ "*": "hard-gate"
65
+ },
66
+ "gateIds": ["artifact-attestation"]
67
+ },
68
+ {
69
+ "ruleId": "GOV-UPGRADE-001",
70
+ "severity": "major",
71
+ "source": "packages/governance/README.md#upgrades-are-optimistic-and-atomic",
72
+ "appliesToRoles": ["*"],
73
+ "match": { "kind": "registry-invariant" },
74
+ "blocking": true,
75
+ "providerCoverage": {
76
+ "*": "hard-gate"
77
+ },
78
+ "gateIds": ["safe-upgrade"]
79
+ }
80
+ ]
81
+ }