Skip to content

Commit 3a5cfd4

Browse files
Merge pull request #555 from proffesor-for-testing/working-july
chore(release): v3.11.5
2 parents a010038 + 235ed8d commit 3a5cfd4

94 files changed

Lines changed: 5289 additions & 445 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agentic-qe",
3-
"version": "3.11.0",
3+
"version": "3.11.5",
44
"description": "Agentic Quality Engineering — AI-powered QE platform with 60 specialized agents, 75+ skills, sublinear coverage analysis, ReasoningBank pattern learning, and deep MCP integration for Claude Code and 11 coding agent platforms",
55
"author": {
66
"name": "Agentic QE Team",

.claude/hooks/aqe-hook.cjs

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,34 +87,68 @@ const FATAL_MARKERS = [
8787
'was compiled against a different Node.js version',
8888
];
8989

90-
function recordHookHealth(stderr) {
90+
// Internal timeout for the spawned bundle process. Kept BELOW the harness's
91+
// own hook timeout (settings.json) so THIS script observes and logs a stall
92+
// itself — if the harness timeout fires first, this whole process is killed
93+
// too and never gets to write the log line. (2026-06-02 postmortem: a 5s
94+
// harness timeout vs. this shim's own admitted ~30-60s cold start left
95+
// routing_outcomes writes silently dropped for a month — nothing recorded
96+
// the mismatch because nothing was watching for it.)
97+
const SPAWN_TIMEOUT_MS = Number(process.env.AQE_HOOK_TIMEOUT_MS) || 18000;
98+
99+
function recordHookHealth(line) {
91100
try {
92-
if (!stderr) return;
93-
const hit = FATAL_MARKERS.find((m) => stderr.includes(m));
94-
if (!hit) return;
95101
const logPath = path.join(PROJECT, '.agentic-qe', 'hooks-health.log');
96102
// Throttle: skip if we logged within the last 5 min (avoid a line/turn).
97103
try {
98104
const st = fs.statSync(logPath);
99105
if (Date.now() - st.mtimeMs < 5 * 60 * 1000) return;
100106
} catch { /* no log yet — fall through and create it */ }
101-
const subcmd = args[0] || 'unknown';
102-
const line = `[${new Date().toISOString()}] FATAL hook persistence failure `
103-
+ `(cmd=${subcmd}): "${hit}". Learning is NOT being captured. `
104-
+ `Fix: \`npm rebuild better-sqlite3\` (host/container native-binary mismatch).\n`;
107+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
105108
fs.appendFileSync(logPath, line);
106109
} catch { /* health logging must never block a turn */ }
107110
}
108111

109112
let out = '';
110113
try {
111114
const res = spawnSync(cmd, cmdArgs, {
112-
stdio: ['ignore', 'pipe', 'pipe'], // swallow stdin; capture stderr to scan
115+
// Claude Code delivers hook event data (prompt, tool_input, etc.) as JSON
116+
// on stdin — `$PROMPT`/`$TOOL_INPUT_*` env-var substitution is NOT
117+
// reliable on every hook surface (see hooks-shared.ts:readStdinJsonEvent's
118+
// own docstring). Discarding stdin here silently broke the CLI's
119+
// existing, already-safe stdin fallback (500ms internal timeout, never
120+
// hangs) — inherit it instead so that fallback can actually run.
121+
stdio: ['inherit', 'pipe', 'pipe'],
113122
encoding: 'utf8',
114123
maxBuffer: 16 * 1024 * 1024,
124+
timeout: SPAWN_TIMEOUT_MS,
115125
});
116126
out = (res && res.stdout) || '';
117-
recordHookHealth((res && res.stderr) || ''); // tee fatal markers to health log
127+
const subcmd = args[0] || 'unknown';
128+
const stderr = (res && res.stderr) || '';
129+
const hit = FATAL_MARKERS.find((m) => stderr.includes(m));
130+
const ts = () => new Date().toISOString();
131+
if (hit) {
132+
recordHookHealth(`[${ts()}] FATAL hook persistence failure `
133+
+ `(cmd=${subcmd}): "${hit}". Learning is NOT being captured. `
134+
+ `Fix: \`npm rebuild better-sqlite3\` (host/container native-binary mismatch).\n`);
135+
} else if (res && res.signal) {
136+
// Killed by our own SPAWN_TIMEOUT_MS (or another signal) before finishing.
137+
// No output means no persistence happened for this invocation.
138+
recordHookHealth(`[${ts()}] TIMEOUT hook did not complete `
139+
+ `(cmd=${subcmd}, signal=${res.signal}, budget=${SPAWN_TIMEOUT_MS}ms). `
140+
+ `Learning for this invocation was NOT captured.\n`);
141+
} else if (res && res.error) {
142+
// spawnSync couldn't even launch the child (ENOENT/EACCES/etc).
143+
recordHookHealth(`[${ts()}] SPAWN-FAILED hook could not start `
144+
+ `(cmd=${subcmd}): ${res.error.message || res.error}. `
145+
+ `Learning for this invocation was NOT captured.\n`);
146+
} else if (res && res.status !== 0 && !out.includes('{')) {
147+
// Child exited non-zero with no JSON payload — e.g. an empty-task throw
148+
// when the harness didn't populate $PROMPT/$TOOL_INPUT_*.
149+
recordHookHealth(`[${ts()}] EMPTY-RESULT hook exited status=${res.status} `
150+
+ `with no JSON output (cmd=${subcmd}). stderr: ${stderr.slice(0, 300)}\n`);
151+
}
118152
} catch { /* never block a turn */ }
119153

120154
// Emit only the top-level JSON object: the first line beginning with '{' through

.claude/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
{
151151
"type": "command",
152152
"command": "sh -c 'exec node \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs\" route --task \"$PROMPT\" --json'",
153-
"timeout": 5000,
153+
"timeout": 20000,
154154
"continueOnError": true
155155
},
156156
{
@@ -167,7 +167,7 @@
167167
{
168168
"type": "command",
169169
"command": "sh -c 'exec node \"${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs\" session-start --session-id \"$SESSION_ID\" --json'",
170-
"timeout": 10000,
170+
"timeout": 25000,
171171
"continueOnError": true
172172
},
173173
{

.claude/skills/skills-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@
939939
},
940940
"metadata": {
941941
"generatedBy": "Agentic QE Fleet",
942-
"fleetVersion": "3.11.4",
942+
"fleetVersion": "3.11.5",
943943
"manifestVersion": "1.4.0",
944944
"lastUpdated": "2026-04-13T00:00:00.000Z",
945945
"contributors": [

.github/workflows/optimized-ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ jobs:
4646
if: always()
4747
run: npm audit --audit-level=high || echo "::warning::devDep CVEs found — fix before they migrate into prod"
4848

49+
# ─── Witness chain audit gate (ADR-070 Phase 6.2 / A13) ───
50+
# Seeds a throwaway chain (append -> archive -> verify, then a deliberate
51+
# tamper) and exercises the real `aqe audit verify --chain=audit` path
52+
# end-to-end. Cheap, independent of the test shards, runs against source
53+
# via tsx — no committed memory.db to check, so this guards the verify()
54+
# logic and CLI wiring itself, not any specific historical data.
55+
witness-chain-audit-gate:
56+
name: Witness Chain Audit Gate
57+
runs-on: ubuntu-latest
58+
timeout-minutes: 5
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-node@v4
62+
with: { node-version: '24.13.0', cache: 'npm' }
63+
- run: npm ci
64+
- run: npx tsx scripts/witness-chain-audit-gate.ts
65+
4966
# ─── Journey Tests: 4 parallel shards ───
5067
# Previously a single 25-min job that timed out. Now 4 shards of ~5-8 min each.
5168

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ coordination/orchestration/*
131131
!src/adapters/claude-flow/
132132
.agentic-qe/aqe.rvf.manifest.json
133133
.agentic-qe/memory/
134+
# ADR-070: Ed25519 witness-chain signing keys — never commit private key material
135+
.agentic-qe/witness-keys/
134136
.agentic-qe/data/learning/state.json
135137
.agentic-qe/data/improvement/state.json
136138
.agentic-qe/a11y-scans/

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,64 @@ All notable changes to the Agentic QE project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.11.5] - 2026-07-07
9+
10+
A system-integrity sweep of the self-learning loop: dream-cycle insights now
11+
genuinely turn into reusable patterns instead of silently piling up, pattern
12+
usage stats are accurate again (no more double-counting or mid-session
13+
regressions), and the witness-chain audit trail, agent-topology tracking, GOAP
14+
plan execution, and SONA continual learning all had real dormant-code or
15+
data-integrity bugs fixed. See
16+
[SYSTEM-INTEGRITY-AUDIT-2026-07-04](docs/analysis/SYSTEM-INTEGRITY-AUDIT-2026-07-04.md)
17+
and the [remediation plan](docs/plans/SYSTEM-INTEGRITY-REMEDIATION-GOAP-PLAN-2026-07-04.md)
18+
for full findings and verification evidence.
19+
20+
### Fixed
21+
22+
- **Dream-cycle insights now genuinely become reusable patterns** — a gate in
23+
the concept-loading path meant the fix that lets `detectGaps`/
24+
`detectOptimizations`/`detectPatternMerges` see real failure/success data
25+
only ever ran in manual tests, never in real scheduled dream cycles. Also
26+
fixed the mechanism that marks an insight "applied": it previously
27+
incremented a counter on the 3 newest insights on every successful task
28+
regardless of whether anything was actually promoted (proven live in
29+
production, with counts as high as 16) — it now only marks an insight
30+
applied when it's genuinely turned into a new pattern.
31+
- **`aqe learning stats` reported the wrong pattern counts** — Total and "By
32+
Domain" now come from the real pattern store instead of an incomplete
33+
vector-index count that silently excluded any pattern without an embedding.
34+
- **Pattern usage was recorded twice per outcome**, inflating usage counts and
35+
success-rate stats 2x; now written once.
36+
- **Pattern lookups could silently fail after a name collision** ("Pattern not
37+
found") because an internal id could go out of sync between the in-memory
38+
cache and the database; fixed for both pattern-store backends.
39+
- **Learning stats could regress mid-session** — reported totals could drop
40+
below the real historical count right after the first pattern-usage event
41+
in a session; now always reports the correct, non-decreasing total.
42+
- **Witness-chain audit trail** — cryptographic signing now covers all new
43+
entries, and a bug that silently broke chain verification for every entry
44+
after an archival operation is fixed, plus a new CI gate to catch
45+
regressions.
46+
- **Agent-topology tracking (mincut)** now reflects real agent activity
47+
instead of a constant placeholder reading, removing a false "critical"
48+
routing state that could occur on an empty graph.
49+
- **GOAP plan execution** now dispatches real domain-API calls for the
50+
majority of actions instead of always simulating (mocking) results.
51+
- **SONA continual-learning cold start** — the self-learning weight-update
52+
mechanism no longer needs 100 requests to accumulate within a single
53+
process lifetime before it can save its first update; progress now
54+
persists across restarts.
55+
- Assorted smaller integrity fixes: pattern-null (failure record) capture
56+
wasn't wired into the production learning path; a stale/expired daemon
57+
process could look "healthy"; a TTL bug caused several cache entries to
58+
live 1000x longer than intended.
59+
60+
### Changed
61+
62+
- Cleaned up dead data left over from now-fixed bugs (degenerate agent-topology
63+
snapshots, orphaned GOAP test-fixture rows, a corrupted insight-tracking
64+
counter) — internal only, no user-facing behavior change.
65+
866
## [3.11.4] - 2026-07-01
967

1068
Better free local-model support, a tamper-evident guard for AQE's learning

assets/skills/skills-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@
939939
},
940940
"metadata": {
941941
"generatedBy": "Agentic QE Fleet",
942-
"fleetVersion": "3.11.0",
942+
"fleetVersion": "3.11.5",
943943
"manifestVersion": "1.4.0",
944944
"lastUpdated": "2026-04-13T00:00:00.000Z",
945945
"contributors": [

0 commit comments

Comments
 (0)