@nforma.ai/nforma 0.2.1

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 (215) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1024 -0
  3. package/agents/qgsd-codebase-mapper.md +764 -0
  4. package/agents/qgsd-debugger.md +1201 -0
  5. package/agents/qgsd-executor.md +472 -0
  6. package/agents/qgsd-integration-checker.md +443 -0
  7. package/agents/qgsd-phase-researcher.md +502 -0
  8. package/agents/qgsd-plan-checker.md +643 -0
  9. package/agents/qgsd-planner.md +1182 -0
  10. package/agents/qgsd-project-researcher.md +621 -0
  11. package/agents/qgsd-quorum-orchestrator.md +628 -0
  12. package/agents/qgsd-quorum-slot-worker.md +41 -0
  13. package/agents/qgsd-quorum-synthesizer.md +133 -0
  14. package/agents/qgsd-quorum-test-worker.md +37 -0
  15. package/agents/qgsd-quorum-worker.md +161 -0
  16. package/agents/qgsd-research-synthesizer.md +239 -0
  17. package/agents/qgsd-roadmapper.md +660 -0
  18. package/agents/qgsd-verifier.md +628 -0
  19. package/bin/accept-debug-invariant.cjs +165 -0
  20. package/bin/account-manager.cjs +719 -0
  21. package/bin/aggregate-requirements.cjs +466 -0
  22. package/bin/analyze-assumptions.cjs +757 -0
  23. package/bin/analyze-state-space.cjs +921 -0
  24. package/bin/attribute-trace-divergence.cjs +150 -0
  25. package/bin/auth-drivers/gh-cli.cjs +93 -0
  26. package/bin/auth-drivers/index.cjs +46 -0
  27. package/bin/auth-drivers/pool.cjs +67 -0
  28. package/bin/auth-drivers/simple.cjs +95 -0
  29. package/bin/autoClosePtoF.cjs +110 -0
  30. package/bin/blessed-terminal.cjs +350 -0
  31. package/bin/build-phase-index.cjs +472 -0
  32. package/bin/call-quorum-slot.cjs +541 -0
  33. package/bin/ccr-secure-config.cjs +99 -0
  34. package/bin/ccr-secure-start.cjs +83 -0
  35. package/bin/check-bundled-sdks.cjs +177 -0
  36. package/bin/check-coverage-guard.cjs +112 -0
  37. package/bin/check-liveness-fairness.cjs +95 -0
  38. package/bin/check-mcp-health.cjs +123 -0
  39. package/bin/check-provider-health.cjs +395 -0
  40. package/bin/check-results-exit.cjs +24 -0
  41. package/bin/check-spec-sync.cjs +360 -0
  42. package/bin/check-trace-redaction.cjs +271 -0
  43. package/bin/check-trace-schema-drift.cjs +99 -0
  44. package/bin/compareDrift.cjs +21 -0
  45. package/bin/conformance-schema.cjs +12 -0
  46. package/bin/count-scenarios.cjs +420 -0
  47. package/bin/debt-dedup.cjs +144 -0
  48. package/bin/debt-ledger.cjs +61 -0
  49. package/bin/debt-retention.cjs +76 -0
  50. package/bin/debt-state-machine.cjs +80 -0
  51. package/bin/detect-coverage-gaps.cjs +204 -0
  52. package/bin/detect-project-intent.cjs +362 -0
  53. package/bin/export-prism-constants.cjs +164 -0
  54. package/bin/extract-annotations.cjs +633 -0
  55. package/bin/extractFormalExpected.cjs +104 -0
  56. package/bin/fingerprint-drift.cjs +24 -0
  57. package/bin/fingerprint-issue.cjs +46 -0
  58. package/bin/formal-core.cjs +519 -0
  59. package/bin/formal-ref-linker.cjs +141 -0
  60. package/bin/formal-test-sync.cjs +788 -0
  61. package/bin/generate-formal-specs.cjs +588 -0
  62. package/bin/generate-petri-net.cjs +397 -0
  63. package/bin/generate-phase-spec.cjs +249 -0
  64. package/bin/generate-proposed-changes.cjs +194 -0
  65. package/bin/generate-tla-cfg.cjs +122 -0
  66. package/bin/generate-traceability-matrix.cjs +701 -0
  67. package/bin/generate-triage-bundle.cjs +300 -0
  68. package/bin/gh-account-rotate.cjs +34 -0
  69. package/bin/initialize-model-registry.cjs +105 -0
  70. package/bin/install-formal-tools.cjs +382 -0
  71. package/bin/install.js +2424 -0
  72. package/bin/isNumericThreshold.cjs +34 -0
  73. package/bin/issue-classifier.cjs +151 -0
  74. package/bin/levenshtein.cjs +74 -0
  75. package/bin/lint-formal-models.cjs +580 -0
  76. package/bin/load-baseline-requirements.cjs +275 -0
  77. package/bin/manage-agents-core.cjs +815 -0
  78. package/bin/migrate-formal-dir.cjs +172 -0
  79. package/bin/migrate-planning.cjs +206 -0
  80. package/bin/migrate-to-slots.cjs +255 -0
  81. package/bin/nForma.cjs +2726 -0
  82. package/bin/observe-config.cjs +353 -0
  83. package/bin/observe-debt-writer.cjs +140 -0
  84. package/bin/observe-handler-grafana.cjs +128 -0
  85. package/bin/observe-handler-internal.cjs +301 -0
  86. package/bin/observe-handler-logstash.cjs +153 -0
  87. package/bin/observe-handler-prometheus.cjs +185 -0
  88. package/bin/observe-handlers.cjs +436 -0
  89. package/bin/observe-registry.cjs +131 -0
  90. package/bin/observe-render.cjs +168 -0
  91. package/bin/planning-paths.cjs +167 -0
  92. package/bin/polyrepo.cjs +560 -0
  93. package/bin/prism-priority.cjs +153 -0
  94. package/bin/probe-quorum-slots.cjs +167 -0
  95. package/bin/promote-model.cjs +225 -0
  96. package/bin/propose-debug-invariants.cjs +165 -0
  97. package/bin/providers.json +392 -0
  98. package/bin/pty-proxy.py +129 -0
  99. package/bin/qgsd-solve.cjs +2477 -0
  100. package/bin/quorum-consensus-gate.cjs +238 -0
  101. package/bin/quorum-formal-context.cjs +183 -0
  102. package/bin/quorum-slot-dispatch.cjs +934 -0
  103. package/bin/read-policy.cjs +60 -0
  104. package/bin/requirement-map.cjs +63 -0
  105. package/bin/requirements-core.cjs +247 -0
  106. package/bin/resolve-cli.cjs +101 -0
  107. package/bin/review-mcp-logs.cjs +294 -0
  108. package/bin/run-account-manager-tlc.cjs +188 -0
  109. package/bin/run-account-pool-alloy.cjs +158 -0
  110. package/bin/run-alloy.cjs +153 -0
  111. package/bin/run-audit-alloy.cjs +187 -0
  112. package/bin/run-breaker-tlc.cjs +181 -0
  113. package/bin/run-formal-check.cjs +395 -0
  114. package/bin/run-formal-verify.cjs +701 -0
  115. package/bin/run-installer-alloy.cjs +188 -0
  116. package/bin/run-oauth-rotation-prism.cjs +132 -0
  117. package/bin/run-oscillation-tlc.cjs +202 -0
  118. package/bin/run-phase-tlc.cjs +228 -0
  119. package/bin/run-prism.cjs +446 -0
  120. package/bin/run-protocol-tlc.cjs +201 -0
  121. package/bin/run-quorum-composition-alloy.cjs +155 -0
  122. package/bin/run-sensitivity-sweep.cjs +231 -0
  123. package/bin/run-stop-hook-tlc.cjs +188 -0
  124. package/bin/run-tlc.cjs +467 -0
  125. package/bin/run-transcript-alloy.cjs +173 -0
  126. package/bin/run-uppaal.cjs +264 -0
  127. package/bin/secrets.cjs +134 -0
  128. package/bin/sensitivity-report.cjs +219 -0
  129. package/bin/sensitivity-sweep-feedback.cjs +194 -0
  130. package/bin/set-secret.cjs +29 -0
  131. package/bin/setup-telemetry-cron.sh +36 -0
  132. package/bin/sweepPtoF.cjs +63 -0
  133. package/bin/sync-baseline-requirements.cjs +290 -0
  134. package/bin/task-envelope.cjs +360 -0
  135. package/bin/telemetry-collector.cjs +229 -0
  136. package/bin/unified-mcp-server.mjs +735 -0
  137. package/bin/update-agents.cjs +369 -0
  138. package/bin/update-scoreboard.cjs +1134 -0
  139. package/bin/validate-debt-entry.cjs +207 -0
  140. package/bin/validate-invariant.cjs +419 -0
  141. package/bin/validate-memory.cjs +389 -0
  142. package/bin/validate-requirements-haiku.cjs +435 -0
  143. package/bin/validate-traces.cjs +438 -0
  144. package/bin/verify-formal-results.cjs +124 -0
  145. package/bin/verify-quorum-health.cjs +273 -0
  146. package/bin/write-check-result.cjs +106 -0
  147. package/bin/xstate-to-tla.cjs +483 -0
  148. package/bin/xstate-trace-walker.cjs +205 -0
  149. package/commands/qgsd/add-phase.md +43 -0
  150. package/commands/qgsd/add-requirement.md +24 -0
  151. package/commands/qgsd/add-todo.md +47 -0
  152. package/commands/qgsd/audit-milestone.md +37 -0
  153. package/commands/qgsd/check-todos.md +45 -0
  154. package/commands/qgsd/cleanup.md +18 -0
  155. package/commands/qgsd/close-formal-gaps.md +33 -0
  156. package/commands/qgsd/complete-milestone.md +136 -0
  157. package/commands/qgsd/debug.md +166 -0
  158. package/commands/qgsd/discuss-phase.md +83 -0
  159. package/commands/qgsd/execute-phase.md +117 -0
  160. package/commands/qgsd/fix-tests.md +27 -0
  161. package/commands/qgsd/formal-test-sync.md +32 -0
  162. package/commands/qgsd/health.md +22 -0
  163. package/commands/qgsd/help.md +22 -0
  164. package/commands/qgsd/insert-phase.md +32 -0
  165. package/commands/qgsd/join-discord.md +18 -0
  166. package/commands/qgsd/list-phase-assumptions.md +46 -0
  167. package/commands/qgsd/map-codebase.md +71 -0
  168. package/commands/qgsd/map-requirements.md +20 -0
  169. package/commands/qgsd/mcp-restart.md +176 -0
  170. package/commands/qgsd/mcp-set-model.md +134 -0
  171. package/commands/qgsd/mcp-setup.md +1371 -0
  172. package/commands/qgsd/mcp-status.md +274 -0
  173. package/commands/qgsd/mcp-update.md +238 -0
  174. package/commands/qgsd/new-milestone.md +44 -0
  175. package/commands/qgsd/new-project.md +42 -0
  176. package/commands/qgsd/observe.md +260 -0
  177. package/commands/qgsd/pause-work.md +38 -0
  178. package/commands/qgsd/plan-milestone-gaps.md +34 -0
  179. package/commands/qgsd/plan-phase.md +44 -0
  180. package/commands/qgsd/polyrepo.md +50 -0
  181. package/commands/qgsd/progress.md +24 -0
  182. package/commands/qgsd/queue.md +54 -0
  183. package/commands/qgsd/quick.md +133 -0
  184. package/commands/qgsd/quorum-test.md +275 -0
  185. package/commands/qgsd/quorum.md +707 -0
  186. package/commands/qgsd/reapply-patches.md +110 -0
  187. package/commands/qgsd/remove-phase.md +31 -0
  188. package/commands/qgsd/research-phase.md +189 -0
  189. package/commands/qgsd/resume-work.md +40 -0
  190. package/commands/qgsd/set-profile.md +34 -0
  191. package/commands/qgsd/settings.md +39 -0
  192. package/commands/qgsd/solve.md +565 -0
  193. package/commands/qgsd/sync-baselines.md +119 -0
  194. package/commands/qgsd/triage.md +233 -0
  195. package/commands/qgsd/update.md +37 -0
  196. package/commands/qgsd/verify-work.md +38 -0
  197. package/hooks/dist/config-loader.js +297 -0
  198. package/hooks/dist/conformance-schema.cjs +12 -0
  199. package/hooks/dist/gsd-context-monitor.js +64 -0
  200. package/hooks/dist/qgsd-check-update.js +62 -0
  201. package/hooks/dist/qgsd-circuit-breaker.js +682 -0
  202. package/hooks/dist/qgsd-precompact.js +156 -0
  203. package/hooks/dist/qgsd-prompt.js +653 -0
  204. package/hooks/dist/qgsd-session-start.js +122 -0
  205. package/hooks/dist/qgsd-slot-correlator.js +58 -0
  206. package/hooks/dist/qgsd-spec-regen.js +86 -0
  207. package/hooks/dist/qgsd-statusline.js +91 -0
  208. package/hooks/dist/qgsd-stop.js +553 -0
  209. package/hooks/dist/qgsd-token-collector.js +133 -0
  210. package/hooks/dist/unified-mcp-server.mjs +669 -0
  211. package/package.json +95 -0
  212. package/scripts/build-hooks.js +46 -0
  213. package/scripts/postinstall.js +48 -0
  214. package/scripts/secret-audit.sh +45 -0
  215. package/templates/qgsd.json +49 -0
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@nforma.ai/nforma",
3
+ "version": "0.2.1",
4
+ "description": "nForma — Quorum Gets Shit Done. Multi-model quorum enforcement for GSD planning commands via Claude Code hooks.",
5
+ "bin": {
6
+ "nforma": "bin/install.js",
7
+ "qgsd": "bin/install.js",
8
+ "get-shit-done-cc": "bin/install.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "!**/*.test.*",
13
+ "commands",
14
+ "get-shit-done",
15
+ "agents",
16
+ "hooks/dist",
17
+ "scripts",
18
+ "!scripts/generate-logo-svg.js",
19
+ "!scripts/generate-terminal-svg.js",
20
+ "!scripts/lint-isolation.js",
21
+ "!scripts/publish.sh",
22
+ "templates"
23
+ ],
24
+ "keywords": [
25
+ "claude",
26
+ "claude-code",
27
+ "ai",
28
+ "meta-prompting",
29
+ "context-engineering",
30
+ "spec-driven-development",
31
+ "gemini",
32
+ "gemini-cli"
33
+ ],
34
+ "author": "nForma AI",
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/nForma-AI/nForma.git"
39
+ },
40
+ "homepage": "https://github.com/nForma-AI/nForma",
41
+ "bugs": {
42
+ "url": "https://github.com/nForma-AI/nForma/issues"
43
+ },
44
+ "engines": {
45
+ "node": ">=16.7.0"
46
+ },
47
+ "dependencies": {
48
+ "@xterm/headless": "^5.5.0",
49
+ "blessed": "^0.1.81",
50
+ "blessed-xterm": "^1.5.1",
51
+ "inquirer": "^8.2.7",
52
+ "keytar": "^7.9.0",
53
+ "node-pty": "^1.1.0"
54
+ },
55
+ "devDependencies": {
56
+ "@hpcc-js/wasm-graphviz": "^1.21.0",
57
+ "esbuild": "^0.27.3",
58
+ "husky": "^9.1.7",
59
+ "lint-staged": "^16.3.2",
60
+ "tsup": "^8.5.1",
61
+ "typescript": "^5.9.3",
62
+ "xstate": "^5.28.0"
63
+ },
64
+ "overrides": {
65
+ "blessed-xterm": {
66
+ "node-pty": "$node-pty"
67
+ }
68
+ },
69
+ "lint-staged": {},
70
+ "scripts": {
71
+ "postinstall": "node scripts/postinstall.js",
72
+ "build:hooks": "node scripts/build-hooks.js",
73
+ "build:machines": "npx tsup src/machines/qgsd-workflow.machine.ts --format cjs --out-dir dist/machines --no-splitting --tsconfig tsconfig.formal.json",
74
+ "generate-terminal": "node scripts/generate-terminal-svg.js",
75
+ "generate-logo": "node scripts/generate-logo-svg.js",
76
+ "generate-assets": "npm run generate-terminal && npm run generate-logo",
77
+ "publish:npm": "bash scripts/publish.sh",
78
+ "prepublishOnly": "npm run build:hooks",
79
+ "xstate-to-tla": "node bin/xstate-to-tla.cjs",
80
+ "formal-verify": "node bin/run-formal-verify.cjs",
81
+ "formal-verify:tla": "node bin/run-formal-verify.cjs --only=tla",
82
+ "formal-verify:alloy": "node bin/run-formal-verify.cjs --only=alloy",
83
+ "formal-verify:prism": "node bin/run-formal-verify.cjs --only=prism",
84
+ "formal-verify:petri": "node bin/run-formal-verify.cjs --only=petri",
85
+ "lint:isolation": "node scripts/lint-isolation.js",
86
+ "secrets:gitleaks": "gitleaks detect --no-banner --source . --config .gitleaks.toml --redact --verbose",
87
+ "secrets:scan": "detect-secrets scan --baseline .secrets.baseline",
88
+ "secrets:audit": "detect-secrets audit .secrets.baseline",
89
+ "secrets:history": "bash scripts/secret-audit.sh",
90
+ "test": "npm run test:ci && npm run test:formal",
91
+ "test:ci": "node scripts/lint-isolation.js && node --test hooks/qgsd-precompact.test.js hooks/gsd-context-monitor.test.js hooks/qgsd-session-start.test.js bin/conformance-schema.test.cjs bin/resolve-cli.test.cjs bin/secrets.test.cjs bin/verify-quorum-health.test.cjs hooks/qgsd-stop.test.js hooks/config-loader.test.js qgsd-core/bin/gsd-tools.test.cjs hooks/qgsd-circuit-breaker.test.js hooks/qgsd-prompt.test.js bin/update-scoreboard.test.cjs hooks/qgsd-statusline.test.js bin/review-mcp-logs.test.cjs bin/migrate-to-slots.test.cjs bin/validate-traces.test.cjs bin/write-check-result.test.cjs bin/check-results-exit.test.cjs bin/check-trace-redaction.test.cjs bin/check-trace-schema-drift.test.cjs bin/qgsd.test.cjs bin/set-secret.test.cjs bin/issue-classifier.test.cjs bin/generate-tla-cfg.test.cjs bin/ccr-secure-config.test.cjs bin/gsd-quorum-slot-worker-improvements.test.cjs bin/quorum-improvements-signal.test.cjs bin/claude-md-references.test.cjs hooks/qgsd-spec-regen.test.js bin/propose-debug-invariants.test.cjs bin/aggregate-requirements.test.cjs bin/validate-requirements-haiku.test.cjs bin/call-quorum-slot-retry.test.cjs bin/provider-mapping.test.cjs",
92
+ "test:formal": "node --test bin/run-tlc.test.cjs bin/run-alloy.test.cjs bin/export-prism-constants.test.cjs bin/generate-petri-net.test.cjs bin/run-breaker-tlc.test.cjs bin/run-oscillation-tlc.test.cjs bin/run-protocol-tlc.test.cjs bin/run-audit-alloy.test.cjs bin/run-transcript-alloy.test.cjs bin/run-installer-alloy.test.cjs bin/run-formal-verify.test.cjs bin/xstate-to-tla.test.cjs bin/run-account-manager-tlc.test.cjs bin/run-account-pool-alloy.test.cjs bin/run-oauth-rotation-prism.test.cjs bin/run-prism.test.cjs bin/check-spec-sync.test.cjs bin/sensitivity-sweep-feedback.test.cjs bin/roadmapper-formal-integration.test.cjs bin/test-formal-integration.test.cjs test/alloy-headless.test.cjs",
93
+ "prepare": "husky"
94
+ }
95
+ }
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copy GSD hooks to dist for installation.
4
+ */
5
+
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ const HOOKS_DIR = path.join(__dirname, '..', 'hooks');
10
+ const DIST_DIR = path.join(HOOKS_DIR, 'dist');
11
+
12
+ // Hooks to copy (pure Node.js, no bundling needed)
13
+ const HOOKS_TO_COPY = [
14
+ 'qgsd-check-update.js',
15
+ 'qgsd-statusline.js',
16
+ 'qgsd-prompt.js', // QGSD: UserPromptSubmit quorum injection hook
17
+ 'qgsd-stop.js', // QGSD: Stop quorum verification gate
18
+ 'config-loader.js', // QGSD: shared config loader (required by qgsd-prompt.js and qgsd-stop.js)
19
+ 'qgsd-circuit-breaker.js', // QGSD: PreToolUse oscillation detection and state persistence
20
+ ];
21
+
22
+ function build() {
23
+ // Ensure dist directory exists
24
+ if (!fs.existsSync(DIST_DIR)) {
25
+ fs.mkdirSync(DIST_DIR, { recursive: true });
26
+ }
27
+
28
+ // Copy hooks to dist
29
+ for (const hook of HOOKS_TO_COPY) {
30
+ const src = path.join(HOOKS_DIR, hook);
31
+ const dest = path.join(DIST_DIR, hook);
32
+
33
+ if (!fs.existsSync(src)) {
34
+ console.warn(`Warning: ${hook} not found, skipping`);
35
+ continue;
36
+ }
37
+
38
+ console.log(`Copying ${hook}...`);
39
+ fs.copyFileSync(src, dest);
40
+ console.log(` → ${dest}`);
41
+ }
42
+
43
+ console.log('\nBuild complete.');
44
+ }
45
+
46
+ build();
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // 1. Remove nested node-pty@1.0.0 so blessed-xterm uses top-level 1.1.0
7
+ try {
8
+ fs.rmSync('node_modules/blessed-xterm/node_modules/node-pty', { recursive: true, force: true });
9
+ } catch (_) {}
10
+
11
+ // 2. Fix spawn-helper permissions (npm strips +x from prebuilt binaries)
12
+ try {
13
+ const helper = path.join('node_modules', 'node-pty', 'prebuilds',
14
+ `${process.platform}-${process.arch}`, 'spawn-helper');
15
+ if (fs.existsSync(helper)) fs.chmodSync(helper, 0o755);
16
+ } catch (_) {}
17
+
18
+ // 3. Patch blessed-xterm clone() to skip screen/parent (they contain tty handles
19
+ // with read-only properties that crash the clone library on modern Node)
20
+ try {
21
+ const file = 'node_modules/blessed-xterm/blessed-xterm.js';
22
+ let src = fs.readFileSync(file, 'utf8');
23
+ if (!src.includes('_screen')) {
24
+ src = src.replace(
25
+ 'options = clone(options)',
26
+ [
27
+ 'const _screen = options.screen; delete options.screen',
28
+ ' const _parent = options.parent; delete options.parent',
29
+ ' options = clone(options)',
30
+ ' if (_screen) options.screen = _screen',
31
+ ' if (_parent) options.parent = _parent',
32
+ ].join('\n')
33
+ );
34
+ fs.writeFileSync(file, src);
35
+ }
36
+ } catch (_) {}
37
+
38
+ // 4. Auto-migrate .planning/ from flat layout to v0.27+ hierarchy
39
+ try {
40
+ const { migrate } = require('../bin/migrate-planning.cjs');
41
+ const root = path.resolve(__dirname, '..');
42
+ if (fs.existsSync(path.join(root, '.planning'))) {
43
+ const stats = migrate(root, false);
44
+ if (stats.moved > 0) {
45
+ console.log(`[postinstall] Migrated .planning/ hierarchy: ${stats.moved} files moved`);
46
+ }
47
+ }
48
+ } catch (_) {}
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+ # secret-audit.sh — Full-history secret audit using gitleaks and trufflehog
3
+ # Usage: bash scripts/secret-audit.sh
4
+ # Runs locally; install gitleaks and trufflehog first.
5
+
6
+ set -euo pipefail
7
+
8
+ echo "=== QGSD Full-History Secret Audit ==="
9
+ echo ""
10
+
11
+ # --- Gitleaks full-history scan ---
12
+ echo "[1/2] Running gitleaks full-history scan..."
13
+ if command -v gitleaks &>/dev/null; then
14
+ gitleaks detect \
15
+ --source . \
16
+ --config .gitleaks.toml \
17
+ --redact \
18
+ --verbose \
19
+ --report-format json \
20
+ --report-path .gitleaks-report.json \
21
+ || echo " -> gitleaks found potential secrets (see .gitleaks-report.json)"
22
+ echo " -> gitleaks report: .gitleaks-report.json"
23
+ else
24
+ echo " -> SKIPPED: gitleaks not installed (brew install gitleaks)"
25
+ fi
26
+
27
+ echo ""
28
+
29
+ # --- TruffleHog full-history scan ---
30
+ echo "[2/2] Running trufflehog full-history scan..."
31
+ if command -v trufflehog &>/dev/null; then
32
+ trufflehog git \
33
+ file://. \
34
+ --only-verified \
35
+ --json \
36
+ > .trufflehog-report.json 2>&1 \
37
+ || echo " -> trufflehog found potential secrets (see .trufflehog-report.json)"
38
+ echo " -> trufflehog report: .trufflehog-report.json"
39
+ else
40
+ echo " -> SKIPPED: trufflehog not installed (brew install trufflehog)"
41
+ fi
42
+
43
+ echo ""
44
+ echo "=== Audit complete ==="
45
+ echo "Report files (.gitleaks-report.json, .trufflehog-report.json) are gitignored."
@@ -0,0 +1,49 @@
1
+ {
2
+ "_comment": [
3
+ "QGSD Quorum Config — generated by QGSD installer. Safe to edit.",
4
+ "",
5
+ "quorum_commands: GSD planning commands that require quorum before Claude delivers output.",
6
+ " Add or remove command names to control which /gsd: commands are gated.",
7
+ "",
8
+ "required_models: Dict of quorum model entries. Key = logical name, value = { tool_prefix, required }.",
9
+ " tool_prefix: MCP tool name prefix — matched with startsWith(). E.g. 'mcp__codex-cli-1__'",
10
+ " matches both mcp__codex-cli-1__review and mcp__codex-cli-1__codex.",
11
+ " required: If true, model must be called (or be unavailable per ~/.claude.json) for quorum.",
12
+ " NOTE: This field was called 'quorum_models' in early requirements. 'required_models' is canonical.",
13
+ "",
14
+ "fail_mode: 'open' (default) — unavailable models are skipped, quorum passes with available models.",
15
+ " 'closed' is reserved for future use.",
16
+ "",
17
+ "Config layering: ~/.claude/qgsd.json (global) is loaded first.",
18
+ " .claude/qgsd.json in the project directory overrides global values (project takes precedence).",
19
+ " Merge is SHALLOW: if a project config sets required_models, it entirely replaces global required_models.",
20
+ " To add a model to the global list, copy the full required_models from global and add your entry.",
21
+ " Create .claude/qgsd.json in a project to restrict quorum to fewer models or different commands.",
22
+ "",
23
+ "circuit_breaker config uses the SAME shallow merge: a project config with only oscillation_depth set",
24
+ " entirely replaces the global circuit_breaker object. commit_window falls back to DEFAULT (6), NOT the global value.",
25
+ " To override only one sub-key, set BOTH sub-keys in your project circuit_breaker block.",
26
+ " Example: { \"circuit_breaker\": { \"oscillation_depth\": 2, \"commit_window\": 6 } }",
27
+ "",
28
+ "MCP prefixes are auto-detected from ~/.claude.json mcpServers on first install.",
29
+ " Edit required_models here to override detected values.",
30
+ "",
31
+ "quorum_active: Array of slot names that participate in quorum. E.g. [\"codex-cli-1\", \"gemini-cli-1\", \"opencode-1\", \"copilot-1\", \"claude-1\"]. Empty array (default) = all discovered slots participate. Populated automatically on install. Override to include/exclude specific slots."
32
+ ],
33
+ "quorum_commands": [
34
+ "plan-phase", "new-project", "new-milestone",
35
+ "discuss-phase", "verify-work", "research-phase"
36
+ ],
37
+ "fail_mode": "open",
38
+ "required_models": {
39
+ "codex": { "tool_prefix": "mcp__codex-cli-1__", "required": true },
40
+ "gemini": { "tool_prefix": "mcp__gemini-cli-1__", "required": true },
41
+ "opencode": { "tool_prefix": "mcp__opencode-1__", "required": true }
42
+ },
43
+ "quorum_instructions": "QUORUM REQUIRED (structural enforcement — Stop hook will verify)\n\nBefore presenting any planning output to the user, you MUST:\n 1. Call mcp__codex-cli-1__review with the full plan content\n 2. Call mcp__gemini-cli-1__gemini with the full plan content\n 3. Call mcp__opencode-1__opencode with the full plan content\n 4. Present all model responses, resolve any concerns, then deliver your final output\n 5. Include the token <!-- GSD_DECISION --> somewhere in your FINAL output (not in intermediate messages or status updates — only when you are delivering the completed plan, research, verification report, or filtered question list to the user)\n\nFail-open: if a model is UNAVAILABLE (quota/error), note it and proceed with available models.\nThe Stop hook reads the transcript — skipping quorum will block your response.",
44
+ "circuit_breaker": {
45
+ "oscillation_depth": 3,
46
+ "commit_window": 6
47
+ },
48
+ "quorum_active": ["codex-cli-1", "gemini-cli-1", "opencode-1", "copilot-1", "claude-1"]
49
+ }