@llm-dev-ops/agentics-cli 2.7.36 → 2.7.38

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 (95) hide show
  1. package/dist/adapters/base-adapter.d.ts.map +1 -1
  2. package/dist/adapters/base-adapter.js.map +1 -1
  3. package/dist/agents/repo-agent-runner.d.ts.map +1 -1
  4. package/dist/agents/repo-agent-runner.js +0 -2
  5. package/dist/agents/repo-agent-runner.js.map +1 -1
  6. package/dist/agents/system-prompts.d.ts.map +1 -1
  7. package/dist/agents/system-prompts.js +0 -19
  8. package/dist/agents/system-prompts.js.map +1 -1
  9. package/dist/cli/index.js +1 -1
  10. package/dist/cli/index.js.map +1 -1
  11. package/dist/commands/agents.d.ts +4 -24
  12. package/dist/commands/agents.d.ts.map +1 -1
  13. package/dist/commands/agents.js +30 -106
  14. package/dist/commands/agents.js.map +1 -1
  15. package/dist/mcp/agent-event-parser.d.ts +1 -11
  16. package/dist/mcp/agent-event-parser.d.ts.map +1 -1
  17. package/dist/mcp/agent-event-parser.js +7 -153
  18. package/dist/mcp/agent-event-parser.js.map +1 -1
  19. package/dist/mcp/mcp-server.js +0 -58
  20. package/dist/mcp/mcp-server.js.map +1 -1
  21. package/dist/pipeline/auto-chain.d.ts.map +1 -1
  22. package/dist/pipeline/auto-chain.js +27 -169
  23. package/dist/pipeline/auto-chain.js.map +1 -1
  24. package/dist/pipeline/local-fallback/phase5a-local-fallback.d.ts +21 -18
  25. package/dist/pipeline/local-fallback/phase5a-local-fallback.d.ts.map +1 -1
  26. package/dist/pipeline/local-fallback/phase5a-local-fallback.js +92 -397
  27. package/dist/pipeline/local-fallback/phase5a-local-fallback.js.map +1 -1
  28. package/dist/pipeline/phase2/phases/adr-generator.d.ts +29 -1
  29. package/dist/pipeline/phase2/phases/adr-generator.d.ts.map +1 -1
  30. package/dist/pipeline/phase2/phases/adr-generator.js +709 -1399
  31. package/dist/pipeline/phase2/phases/adr-generator.js.map +1 -1
  32. package/dist/pipeline/phase2/phases/ddd-generator.d.ts.map +1 -1
  33. package/dist/pipeline/phase2/phases/ddd-generator.js +7 -42
  34. package/dist/pipeline/phase2/phases/ddd-generator.js.map +1 -1
  35. package/dist/pipeline/phase2/phases/research-dossier.d.ts.map +1 -1
  36. package/dist/pipeline/phase2/phases/research-dossier.js +2 -33
  37. package/dist/pipeline/phase2/phases/research-dossier.js.map +1 -1
  38. package/dist/pipeline/phase2/phases/sparc-specification.d.ts.map +1 -1
  39. package/dist/pipeline/phase2/phases/sparc-specification.js +2 -27
  40. package/dist/pipeline/phase2/phases/sparc-specification.js.map +1 -1
  41. package/dist/pipeline/phase2/types.d.ts +19 -57
  42. package/dist/pipeline/phase2/types.d.ts.map +1 -1
  43. package/dist/pipeline/phase4-adrs/adr-index-extractor.d.ts +75 -0
  44. package/dist/pipeline/phase4-adrs/adr-index-extractor.d.ts.map +1 -0
  45. package/dist/pipeline/phase4-adrs/adr-index-extractor.js +200 -0
  46. package/dist/pipeline/phase4-adrs/adr-index-extractor.js.map +1 -0
  47. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.d.ts.map +1 -1
  48. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js +70 -68
  49. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js.map +1 -1
  50. package/dist/pipeline/phase7/deliverables-registry.js +1 -1
  51. package/dist/pipeline/phase7/deliverables-registry.js.map +1 -1
  52. package/dist/pipeline/phases/adr-ddd-generator.d.ts.map +1 -1
  53. package/dist/pipeline/phases/adr-ddd-generator.js +48 -2
  54. package/dist/pipeline/phases/adr-ddd-generator.js.map +1 -1
  55. package/dist/pipeline/phases/prompt-generator.js +191 -80
  56. package/dist/pipeline/phases/prompt-generator.js.map +1 -1
  57. package/dist/pipeline/ruflo-phase-executor.d.ts +2 -5
  58. package/dist/pipeline/ruflo-phase-executor.d.ts.map +1 -1
  59. package/dist/pipeline/ruflo-phase-executor.js +72 -23
  60. package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
  61. package/dist/pipeline/types.d.ts +14 -1
  62. package/dist/pipeline/types.d.ts.map +1 -1
  63. package/dist/routing/domain-boundary.d.ts +4 -20
  64. package/dist/routing/domain-boundary.d.ts.map +1 -1
  65. package/dist/routing/domain-boundary.js +6 -81
  66. package/dist/routing/domain-boundary.js.map +1 -1
  67. package/dist/routing/graph-router.d.ts.map +1 -1
  68. package/dist/routing/graph-router.js +0 -22
  69. package/dist/routing/graph-router.js.map +1 -1
  70. package/dist/synthesis/ask-artifact-writer.d.ts +1 -1
  71. package/dist/synthesis/ask-artifact-writer.d.ts.map +1 -1
  72. package/dist/synthesis/ask-artifact-writer.js +9 -9
  73. package/dist/synthesis/ask-artifact-writer.js.map +1 -1
  74. package/dist/synthesis/simulation-artifact-generator.d.ts +1 -27
  75. package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
  76. package/dist/synthesis/simulation-artifact-generator.js +38 -128
  77. package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
  78. package/docs/ecosystem.graph.json +15 -65
  79. package/package.json +1 -1
  80. package/dist/cli/ui/heartbeat.d.ts +0 -88
  81. package/dist/cli/ui/heartbeat.d.ts.map +0 -1
  82. package/dist/cli/ui/heartbeat.js +0 -158
  83. package/dist/cli/ui/heartbeat.js.map +0 -1
  84. package/dist/config/qe-gating.d.ts +0 -81
  85. package/dist/config/qe-gating.d.ts.map +0 -1
  86. package/dist/config/qe-gating.js +0 -138
  87. package/dist/config/qe-gating.js.map +0 -1
  88. package/dist/pipeline/phase5-build/qe-gating-executor.d.ts +0 -73
  89. package/dist/pipeline/phase5-build/qe-gating-executor.d.ts.map +0 -1
  90. package/dist/pipeline/phase5-build/qe-gating-executor.js +0 -134
  91. package/dist/pipeline/phase5-build/qe-gating-executor.js.map +0 -1
  92. package/dist/synthesis/agent-fleet-decomposer.d.ts +0 -124
  93. package/dist/synthesis/agent-fleet-decomposer.d.ts.map +0 -1
  94. package/dist/synthesis/agent-fleet-decomposer.js +0 -696
  95. package/dist/synthesis/agent-fleet-decomposer.js.map +0 -1
@@ -1,88 +0,0 @@
1
- /**
2
- * ADR-PIPELINE-099 D3 + D4 — Process-wide pipeline heartbeat.
3
- *
4
- * Singleton that emits a continuous "still alive" signal for the entire
5
- * `agentics ask` lifecycle, not just Phase 1. Replaces the per-call heartbeat
6
- * inside `executeNaturalLanguageRoute` which died as soon as auto-chain
7
- * took over Phases 2–7, leaving the user staring at a silent terminal for
8
- * minutes at a stretch.
9
- *
10
- * Two render modes:
11
- *
12
- * - **TTY** (`stderr.isTTY` and not opted out): a single status line is
13
- * repainted in place every 250ms at the cursor position using a four-frame
14
- * spinner (`◐ ◓ ◑ ◒`). The line shows the current phase, total elapsed
15
- * time, time-since-phase-entry, and the most recent activity hint set by
16
- * the pipeline. Other writers (`console.error`, `process.stderr.write`)
17
- * print above the status line via cursor save/restore.
18
- *
19
- * - **Non-TTY** (CI, piped output, `AGENTICS_NO_HEARTBEAT=1`): the spinner
20
- * is suppressed; instead a plain `[agentics] ⏳ still working — Phase X
21
- * (MM:SS) — <activity>` line prints every 10 seconds, throttled to skip
22
- * any tick that happened within 9s of another stderr write.
23
- *
24
- * The singleton is crash-safe: `process.on('exit' | 'SIGINT' | 'SIGTERM')`
25
- * handlers call `stop()` to clear the live status line so it doesn't leave a
26
- * stale frame on the user's terminal after Ctrl-C.
27
- *
28
- * Usage:
29
- * ```ts
30
- * import { pipelineHeartbeat } from './cli/ui/heartbeat.js';
31
- * pipelineHeartbeat.start('agentics ask');
32
- * pipelineHeartbeat.setPhase('Phase 4 — ADRs + DDDs');
33
- * pipelineHeartbeat.setActivity('ruflo: writing adr-007');
34
- * // ... long-running work ...
35
- * pipelineHeartbeat.stop();
36
- * ```
37
- */
38
- declare class PipelineHeartbeat {
39
- private readonly started;
40
- private phase;
41
- private phaseStartedAt;
42
- private activity;
43
- private timer;
44
- private mode;
45
- private lastStderrWriteAt;
46
- private exitHandlersInstalled;
47
- /**
48
- * Begin emitting heartbeat ticks. Idempotent — repeated `start()` calls
49
- * with a different label update the label but do not restart the timer.
50
- *
51
- * Always uses plain-line mode (no stderr interception, no in-place
52
- * cursor manipulation). The previous TTY-with-interceptor design risked
53
- * swallowing other writers' output when the wrapped function chain
54
- * misbehaved (observed in 2.7.27 — the user saw NO output for 6 min
55
- * because the interceptor ate every console.error). Plain-line mode
56
- * interleaves with other logs but is provably safe.
57
- */
58
- start(_label: string): void;
59
- /**
60
- * Update the current phase label. Emits an immediate `[agentics] ▶ <phase>`
61
- * line to stderr so the user sees the boundary even before the next 10s
62
- * tick. Resets the per-phase timer.
63
- */
64
- setPhase(phase: string): void;
65
- /**
66
- * Update the latest activity hint. Stored for the next 10s tick to print
67
- * if no other writer beat it. Does NOT print on its own — that's what
68
- * caused 2.7.27's silence.
69
- */
70
- setActivity(activity: string): void;
71
- /** Stop the timer. */
72
- stop(): void;
73
- private tickPlain;
74
- private installExitHandlers;
75
- }
76
- /** Process-wide singleton. */
77
- export declare const pipelineHeartbeat: PipelineHeartbeat;
78
- /**
79
- * Bracket a phase with `[BEGIN]` / `[END]` log markers and update the
80
- * heartbeat's phase label. Call at the top of each phase in auto-chain.
81
- *
82
- * Returns a `done()` closure that emits the matching `[END]` line when the
83
- * phase finishes. Always pair `phaseBoundary` with its returned `done` to
84
- * keep the trace greppable.
85
- */
86
- export declare function phaseBoundary(phaseLabel: string, totalElapsedFromStart: number): () => void;
87
- export {};
88
- //# sourceMappingURL=heartbeat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAYH,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,IAAI,CAA0B;IACtC,OAAO,CAAC,iBAAiB,CAAc;IACvC,OAAO,CAAC,qBAAqB,CAAS;IAEtC;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAU3B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY7B;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,sBAAsB;IACtB,IAAI,IAAI,IAAI;IAUZ,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,mBAAmB;CAQ5B;AAED,8BAA8B;AAC9B,eAAO,MAAM,iBAAiB,mBAA0B,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,GAAG,MAAM,IAAI,CAkB3F"}
@@ -1,158 +0,0 @@
1
- /**
2
- * ADR-PIPELINE-099 D3 + D4 — Process-wide pipeline heartbeat.
3
- *
4
- * Singleton that emits a continuous "still alive" signal for the entire
5
- * `agentics ask` lifecycle, not just Phase 1. Replaces the per-call heartbeat
6
- * inside `executeNaturalLanguageRoute` which died as soon as auto-chain
7
- * took over Phases 2–7, leaving the user staring at a silent terminal for
8
- * minutes at a stretch.
9
- *
10
- * Two render modes:
11
- *
12
- * - **TTY** (`stderr.isTTY` and not opted out): a single status line is
13
- * repainted in place every 250ms at the cursor position using a four-frame
14
- * spinner (`◐ ◓ ◑ ◒`). The line shows the current phase, total elapsed
15
- * time, time-since-phase-entry, and the most recent activity hint set by
16
- * the pipeline. Other writers (`console.error`, `process.stderr.write`)
17
- * print above the status line via cursor save/restore.
18
- *
19
- * - **Non-TTY** (CI, piped output, `AGENTICS_NO_HEARTBEAT=1`): the spinner
20
- * is suppressed; instead a plain `[agentics] ⏳ still working — Phase X
21
- * (MM:SS) — <activity>` line prints every 10 seconds, throttled to skip
22
- * any tick that happened within 9s of another stderr write.
23
- *
24
- * The singleton is crash-safe: `process.on('exit' | 'SIGINT' | 'SIGTERM')`
25
- * handlers call `stop()` to clear the live status line so it doesn't leave a
26
- * stale frame on the user's terminal after Ctrl-C.
27
- *
28
- * Usage:
29
- * ```ts
30
- * import { pipelineHeartbeat } from './cli/ui/heartbeat.js';
31
- * pipelineHeartbeat.start('agentics ask');
32
- * pipelineHeartbeat.setPhase('Phase 4 — ADRs + DDDs');
33
- * pipelineHeartbeat.setActivity('ruflo: writing adr-007');
34
- * // ... long-running work ...
35
- * pipelineHeartbeat.stop();
36
- * ```
37
- */
38
- const PLAIN_TICK_MS = 10_000;
39
- const PLAIN_QUIET_THRESHOLD_MS = 9_000;
40
- function fmtElapsed(ms) {
41
- const totalSec = Math.floor(ms / 1000);
42
- const m = Math.floor(totalSec / 60);
43
- const s = totalSec % 60;
44
- return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`;
45
- }
46
- class PipelineHeartbeat {
47
- started = Date.now();
48
- phase = 'starting';
49
- phaseStartedAt = Date.now();
50
- activity = '';
51
- timer = null;
52
- mode = 'off';
53
- lastStderrWriteAt = Date.now();
54
- exitHandlersInstalled = false;
55
- /**
56
- * Begin emitting heartbeat ticks. Idempotent — repeated `start()` calls
57
- * with a different label update the label but do not restart the timer.
58
- *
59
- * Always uses plain-line mode (no stderr interception, no in-place
60
- * cursor manipulation). The previous TTY-with-interceptor design risked
61
- * swallowing other writers' output when the wrapped function chain
62
- * misbehaved (observed in 2.7.27 — the user saw NO output for 6 min
63
- * because the interceptor ate every console.error). Plain-line mode
64
- * interleaves with other logs but is provably safe.
65
- */
66
- start(_label) {
67
- if (this.timer)
68
- return;
69
- if (process.env['AGENTICS_HEARTBEAT_OFF'] === '1')
70
- return;
71
- this.mode = 'plain';
72
- this.installExitHandlers();
73
- this.timer = setInterval(() => this.tickPlain(), PLAIN_TICK_MS);
74
- this.timer.unref();
75
- }
76
- /**
77
- * Update the current phase label. Emits an immediate `[agentics] ▶ <phase>`
78
- * line to stderr so the user sees the boundary even before the next 10s
79
- * tick. Resets the per-phase timer.
80
- */
81
- setPhase(phase) {
82
- if (this.phase === phase)
83
- return;
84
- this.phase = phase;
85
- this.phaseStartedAt = Date.now();
86
- this.activity = '';
87
- if (this.mode !== 'off') {
88
- const elapsed = fmtElapsed(Date.now() - this.started);
89
- process.stderr.write(`[agentics] ▶ ${phase} · T+${elapsed}\n`);
90
- this.lastStderrWriteAt = Date.now();
91
- }
92
- }
93
- /**
94
- * Update the latest activity hint. Stored for the next 10s tick to print
95
- * if no other writer beat it. Does NOT print on its own — that's what
96
- * caused 2.7.27's silence.
97
- */
98
- setActivity(activity) {
99
- this.activity = activity;
100
- }
101
- /** Stop the timer. */
102
- stop() {
103
- if (this.timer) {
104
- clearInterval(this.timer);
105
- this.timer = null;
106
- }
107
- this.mode = 'off';
108
- }
109
- // ── Internal ─────────────────────────────────────────────────────────────
110
- tickPlain() {
111
- if (this.mode === 'off')
112
- return;
113
- // Skip if some other writer just printed something — the user already
114
- // has a fresh signal that we're alive.
115
- if (Date.now() - this.lastStderrWriteAt < PLAIN_QUIET_THRESHOLD_MS)
116
- return;
117
- const elapsed = fmtElapsed(Date.now() - this.started);
118
- const phaseSegment = this.phase ? `${this.phase} (${fmtElapsed(Date.now() - this.phaseStartedAt)})` : '';
119
- const activitySegment = this.activity ? ` — ${this.activity}` : '';
120
- process.stderr.write(`[agentics] ⏳ still working — ${elapsed} — ${phaseSegment}${activitySegment}\n`);
121
- this.lastStderrWriteAt = Date.now();
122
- }
123
- installExitHandlers() {
124
- if (this.exitHandlersInstalled)
125
- return;
126
- this.exitHandlersInstalled = true;
127
- const cleanup = () => this.stop();
128
- process.on('exit', cleanup);
129
- process.on('SIGINT', () => { cleanup(); process.exit(130); });
130
- process.on('SIGTERM', () => { cleanup(); process.exit(143); });
131
- }
132
- }
133
- /** Process-wide singleton. */
134
- export const pipelineHeartbeat = new PipelineHeartbeat();
135
- /**
136
- * Bracket a phase with `[BEGIN]` / `[END]` log markers and update the
137
- * heartbeat's phase label. Call at the top of each phase in auto-chain.
138
- *
139
- * Returns a `done()` closure that emits the matching `[END]` line when the
140
- * phase finishes. Always pair `phaseBoundary` with its returned `done` to
141
- * keep the trace greppable.
142
- */
143
- export function phaseBoundary(phaseLabel, totalElapsedFromStart) {
144
- const tStart = Date.now();
145
- const t = fmtElapsed(totalElapsedFromStart);
146
- pipelineHeartbeat.setPhase(phaseLabel);
147
- // ANSI bold for the [BEGIN] marker so it stands out in scrollback.
148
- process.stderr.write(`\n${'='.repeat(72)}\n` +
149
- ` ▶ ${phaseLabel} [BEGIN] T+${t}\n` +
150
- `${'='.repeat(72)}\n`);
151
- return () => {
152
- const dur = fmtElapsed(Date.now() - tStart);
153
- process.stderr.write(`${'='.repeat(72)}\n` +
154
- ` ▼ ${phaseLabel} ✓ completed (${dur}) [END]\n` +
155
- `${'='.repeat(72)}\n\n`);
156
- };
157
- }
158
- //# sourceMappingURL=heartbeat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../../../src/cli/ui/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAEvC,SAAS,UAAU,CAAC,EAAU;IAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC;IACxB,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ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,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI;YACrB,OAAO,UAAU,mBAAmB,GAAG,YAAY;YACnD,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CACxB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,81 +0,0 @@
1
- /**
2
- * QE Gating Config (ADR-PIPELINE-086)
3
- *
4
- * Resolves the AGENTICS_QE_GATING mode from either the env var or a persisted
5
- * config file in ~/.agentics/qe-gating.json. Emits structured bypass records
6
- * when the mode is not `on`.
7
- *
8
- * Source precedence (highest → lowest):
9
- * 1. AGENTICS_QE_GATING env var
10
- * 2. Persisted config at <configDir>/qe-gating.json
11
- * 3. Default: `on`
12
- *
13
- * The persisted file is the mechanism on-call uses outside of env-var
14
- * environments (e.g., managed deployments where env vars require a redeploy).
15
- * Both paths require a non-empty reason when setting anything other than `on`
16
- * — callers that persist without a reason will throw.
17
- */
18
- export type QeGatingMode = 'on' | 'advisory' | 'off';
19
- export declare const DEFAULT_MODE: QeGatingMode;
20
- export declare const ENV_VAR_NAME = "AGENTICS_QE_GATING";
21
- export declare const CONFIG_FILE = "qe-gating.json";
22
- export declare const DEFAULT_CONFIG_DIR: string;
23
- export interface PersistedQeGating {
24
- mode: QeGatingMode;
25
- reason: string;
26
- applied_at: string;
27
- applied_by?: string;
28
- correlation_id?: string;
29
- }
30
- export interface ResolvedQeGating {
31
- mode: QeGatingMode;
32
- source: 'env' | 'persisted' | 'default';
33
- /** The reason string, if available (empty for env-default paths). */
34
- reason?: string;
35
- /** The raw env var value, if that was the source. */
36
- rawEnv?: string;
37
- }
38
- export interface ResolveOptions {
39
- /**
40
- * Override the environment. Defaults to `process.env`. Tests pass a fixture.
41
- */
42
- env?: NodeJS.ProcessEnv;
43
- /** Override the config dir. Defaults to `~/.agentics`. */
44
- configDir?: string;
45
- }
46
- export interface PersistOptions {
47
- configDir?: string;
48
- correlationId?: string;
49
- appliedBy?: string;
50
- /** Clock override for tests. */
51
- now?: Date;
52
- }
53
- export declare class InvalidGatingValueError extends Error {
54
- readonly code: "INVALID_QE_GATING_VALUE";
55
- readonly value: string;
56
- constructor(value: string);
57
- }
58
- export declare class EmptyReasonError extends Error {
59
- readonly code: "EMPTY_QE_GATING_REASON";
60
- constructor();
61
- }
62
- /**
63
- * Parse a raw env-var value. Accepts exactly one of: on, advisory, off
64
- * (case-insensitive; whitespace-trimmed). Empty / undefined returns null so
65
- * callers can fall through to persisted / default resolution.
66
- */
67
- export declare function parseGatingValue(raw: string | undefined): QeGatingMode | null;
68
- export declare function loadPersistedQeGating(opts?: ResolveOptions): PersistedQeGating | null;
69
- /**
70
- * Persist a gating decision. Throws `EmptyReasonError` if mode is not `on`
71
- * and reason is empty. Creates the config dir if missing.
72
- */
73
- export declare function persistQeGating(mode: QeGatingMode, reason: string, opts?: PersistOptions): PersistedQeGating;
74
- /**
75
- * Resolve the effective gating mode from env > persisted > default.
76
- */
77
- export declare function resolveQeGatingMode(opts?: ResolveOptions): ResolvedQeGating;
78
- export declare function isGatingOn(opts?: ResolveOptions): boolean;
79
- export declare function isGatingAdvisory(opts?: ResolveOptions): boolean;
80
- export declare function isGatingOff(opts?: ResolveOptions): boolean;
81
- //# sourceMappingURL=qe-gating.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"qe-gating.d.ts","sourceRoot":"","sources":["../../src/config/qe-gating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,UAAU,GAAG,KAAK,CAAC;AAErD,eAAO,MAAM,YAAY,EAAE,YAAmB,CAAC;AAC/C,eAAO,MAAM,YAAY,uBAAuB,CAAC;AACjD,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,kBAAkB,QAA+B,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UA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mBAAmB,CAAC,IAAI,GAAE,cAAmB,GAAG,gBAAgB,CAiB/E;AAMD,wBAAgB,UAAU,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAE7D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAEnE;AAED,wBAAgB,WAAW,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAE9D"}
@@ -1,138 +0,0 @@
1
- /**
2
- * QE Gating Config (ADR-PIPELINE-086)
3
- *
4
- * Resolves the AGENTICS_QE_GATING mode from either the env var or a persisted
5
- * config file in ~/.agentics/qe-gating.json. Emits structured bypass records
6
- * when the mode is not `on`.
7
- *
8
- * Source precedence (highest → lowest):
9
- * 1. AGENTICS_QE_GATING env var
10
- * 2. Persisted config at <configDir>/qe-gating.json
11
- * 3. Default: `on`
12
- *
13
- * The persisted file is the mechanism on-call uses outside of env-var
14
- * environments (e.g., managed deployments where env vars require a redeploy).
15
- * Both paths require a non-empty reason when setting anything other than `on`
16
- * — callers that persist without a reason will throw.
17
- */
18
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
19
- import { homedir } from 'node:os';
20
- import { join, dirname } from 'node:path';
21
- export const DEFAULT_MODE = 'on';
22
- export const ENV_VAR_NAME = 'AGENTICS_QE_GATING';
23
- export const CONFIG_FILE = 'qe-gating.json';
24
- export const DEFAULT_CONFIG_DIR = join(homedir(), '.agentics');
25
- // ============================================================================
26
- // Parsing
27
- // ============================================================================
28
- export class InvalidGatingValueError extends Error {
29
- code = 'INVALID_QE_GATING_VALUE';
30
- value;
31
- constructor(value) {
32
- super(`Invalid ${ENV_VAR_NAME} value "${value}" — must be one of: on, advisory, off`);
33
- this.value = value;
34
- this.name = 'InvalidGatingValueError';
35
- }
36
- }
37
- export class EmptyReasonError extends Error {
38
- code = 'EMPTY_QE_GATING_REASON';
39
- constructor() {
40
- super(`Non-empty reason is required when setting ${ENV_VAR_NAME} to advisory or off (ADR-086 §2 audit trail requirement)`);
41
- this.name = 'EmptyReasonError';
42
- }
43
- }
44
- /**
45
- * Parse a raw env-var value. Accepts exactly one of: on, advisory, off
46
- * (case-insensitive; whitespace-trimmed). Empty / undefined returns null so
47
- * callers can fall through to persisted / default resolution.
48
- */
49
- export function parseGatingValue(raw) {
50
- if (raw === undefined || raw === null)
51
- return null;
52
- const trimmed = raw.trim().toLowerCase();
53
- if (trimmed === '')
54
- return null;
55
- if (trimmed === 'on' || trimmed === 'advisory' || trimmed === 'off')
56
- return trimmed;
57
- throw new InvalidGatingValueError(raw);
58
- }
59
- // ============================================================================
60
- // Persisted config (file-backed)
61
- // ============================================================================
62
- function persistedPath(configDir) {
63
- return join(configDir, CONFIG_FILE);
64
- }
65
- export function loadPersistedQeGating(opts = {}) {
66
- const configDir = opts.configDir ?? DEFAULT_CONFIG_DIR;
67
- const path = persistedPath(configDir);
68
- if (!existsSync(path))
69
- return null;
70
- try {
71
- const raw = readFileSync(path, 'utf-8');
72
- const parsed = JSON.parse(raw);
73
- // Round-trip validation: mode must be a legal value.
74
- if (parseGatingValue(parsed.mode) === null)
75
- return null;
76
- return parsed;
77
- }
78
- catch {
79
- return null;
80
- }
81
- }
82
- /**
83
- * Persist a gating decision. Throws `EmptyReasonError` if mode is not `on`
84
- * and reason is empty. Creates the config dir if missing.
85
- */
86
- export function persistQeGating(mode, reason, opts = {}) {
87
- if (mode !== 'on' && (!reason || reason.trim() === '')) {
88
- throw new EmptyReasonError();
89
- }
90
- const configDir = opts.configDir ?? DEFAULT_CONFIG_DIR;
91
- const path = persistedPath(configDir);
92
- mkdirSync(dirname(path), { recursive: true });
93
- const now = opts.now ?? new Date();
94
- const record = {
95
- mode,
96
- reason: reason.trim(),
97
- applied_at: now.toISOString(),
98
- ...(opts.appliedBy !== undefined ? { applied_by: opts.appliedBy } : {}),
99
- ...(opts.correlationId !== undefined ? { correlation_id: opts.correlationId } : {}),
100
- };
101
- writeFileSync(path, JSON.stringify(record, null, 2) + '\n', 'utf-8');
102
- return record;
103
- }
104
- // ============================================================================
105
- // Resolution
106
- // ============================================================================
107
- /**
108
- * Resolve the effective gating mode from env > persisted > default.
109
- */
110
- export function resolveQeGatingMode(opts = {}) {
111
- const env = opts.env ?? process.env;
112
- const rawEnv = env[ENV_VAR_NAME];
113
- const fromEnv = parseGatingValue(rawEnv);
114
- if (fromEnv !== null) {
115
- const result = { mode: fromEnv, source: 'env' };
116
- if (rawEnv !== undefined)
117
- result.rawEnv = rawEnv;
118
- return result;
119
- }
120
- const persisted = loadPersistedQeGating(opts);
121
- if (persisted !== null) {
122
- return { mode: persisted.mode, source: 'persisted', reason: persisted.reason };
123
- }
124
- return { mode: DEFAULT_MODE, source: 'default' };
125
- }
126
- // ============================================================================
127
- // Short-hand helpers
128
- // ============================================================================
129
- export function isGatingOn(opts = {}) {
130
- return resolveQeGatingMode(opts).mode === 'on';
131
- }
132
- export function isGatingAdvisory(opts = {}) {
133
- return resolveQeGatingMode(opts).mode === 'advisory';
134
- }
135
- export function isGatingOff(opts = {}) {
136
- return resolveQeGatingMode(opts).mode === 'off';
137
- }
138
- //# sourceMappingURL=qe-gating.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"qe-gating.js","sourceRoot":"","sources":["../../src/config/qe-gating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQ1C,MAAM,CAAC,MAAM,YAAY,GAAiB,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAC5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,EAAE,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EAAE;IAClD,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAuB,EAAE;IACxD,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAuB,EAAE;IACnD,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC;AAClD,CAAC"}
@@ -1,73 +0,0 @@
1
- /**
2
- * QE Gating Executor (ADR-PIPELINE-086)
3
- *
4
- * Encapsulates the phase-8-validation decision tree driven by the gating mode
5
- * resolved from env / persisted config (see src/config/qe-gating.ts).
6
- *
7
- * Contract:
8
- * on → run all mandatory QE agents; any failure halts the pipeline
9
- * with exit code 141 (via Ruvector Acceptance Gate integration
10
- * upstream). The executor returns `status: 'completed'` or throws.
11
- * advisory → run all mandatory QE agents; failures become warnings in the
12
- * output. Returns `status: 'completed_with_warnings'`.
13
- * off → skip QE invocation entirely. Returns `status: 'bypassed'`.
14
- *
15
- * The executor is pure — it does not invoke agents itself; callers pass in an
16
- * `invokeAgent` callback. This keeps the module testable without a live
17
- * pipeline and independent of adapter implementation.
18
- */
19
- import type { QeGatingMode, ResolvedQeGating } from '../../config/qe-gating.js';
20
- export type Phase8Status = 'completed' | 'completed_with_warnings' | 'bypassed';
21
- export interface QeAgentInvocation {
22
- agent: string;
23
- status: 200 | 502;
24
- data?: Record<string, unknown>;
25
- error?: string;
26
- timing_ms?: number;
27
- }
28
- export interface QeExecutionOutcome {
29
- status: Phase8Status;
30
- mode: QeGatingMode;
31
- source: ResolvedQeGating['source'];
32
- invocations: readonly QeAgentInvocation[];
33
- warnings: readonly string[];
34
- bypassRecord?: BypassRecord;
35
- /** Exit code upstream should propagate on failure (on mode only). */
36
- exitCode?: number;
37
- }
38
- export interface BypassRecord {
39
- timestamp: string;
40
- mode: 'advisory' | 'off';
41
- source: ResolvedQeGating['source'];
42
- reason?: string;
43
- correlation_id: string;
44
- affected_agents: readonly string[];
45
- }
46
- export type InvokeAgentFn = (agentId: string) => Promise<QeAgentInvocation>;
47
- export interface ExecuteOptions {
48
- correlationId: string;
49
- /** Explicit mode override (tests). If omitted, resolves from env/persisted. */
50
- modeOverride?: ResolvedQeGating;
51
- /** Clock override. */
52
- now?: Date;
53
- }
54
- /**
55
- * Run phase-8 QE validation per the gating mode.
56
- *
57
- * @param mandatoryAgents — list of agent IDs the phase requires (from ADR-083)
58
- * @param invokeAgent — callback that dispatches a single agent invocation
59
- * @param options — correlation id + optional mode override
60
- */
61
- export declare function executePhase8Qe(mandatoryAgents: readonly string[], invokeAgent: InvokeAgentFn, options: ExecuteOptions): Promise<QeExecutionOutcome>;
62
- /**
63
- * Emit a structured JSON log line to stderr describing a gating bypass.
64
- * Observatory consumes this via the standard stderr-to-metrics pipeline.
65
- */
66
- export declare function emitBypassLog(record: BypassRecord, writeLine?: (s: string) => void): void;
67
- /**
68
- * Build the Markdown header block stamped onto VALIDATION_REPORT.md when a
69
- * bypass occurs. Callers prepend this to the normal report body so reviewers
70
- * see the bypass at the top.
71
- */
72
- export declare function buildValidationReportBypassHeader(record: BypassRecord): string;
73
- //# sourceMappingURL=qe-gating-executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"qe-gating-executor.d.ts","sourceRoot":"","sources":["../../../src/pipeline/phase5-build/qe-gating-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAOhF,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,yBAAyB,GAAG,UAAU,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM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