@event4u/agent-config 14.13.0 → 14.14.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.
- package/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +138 -376
- package/README.md +1 -1
- package/dist/agent-src/commands/analyze/inbox.md +36 -0
- package/dist/agent-src/commands/pr/create.md +16 -1
- package/dist/agent-src/contexts/execution/terminal-states.md +25 -4
- package/dist/agent-src/rules/code-comment-discipline.md +6 -0
- package/dist/agent-src/rules/missing-skill-recovery.md +2 -2
- package/dist/agent-src/rules/token-budget-discipline.md +2 -2
- package/dist/agent-src/scripts/archive_completed_roadmaps.ts +6 -6
- package/dist/agent-src/scripts/guarded_baseline.ts +22 -7
- package/dist/agent-src/scripts/stubs_due.ts +118 -2
- package/dist/agent-src/scripts/update_roadmap_progress.ts +8 -8
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/cli/registry.js +1 -0
- package/dist/cli-delegate/{chunk-ILMUPLGW.js → chunk-7RXIKF62.js} +159 -86
- package/dist/cli-delegate/cmd_conformance.js +39 -2
- package/dist/cli-delegate/cmd_doctor.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +7 -7
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/dispatch.js +1696 -812
- package/dist/mcp/registry-manifest.json +2 -2
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +297 -115
- package/docs/guidelines/agent-infra/guarded-baseline.md +1 -1
- package/docs/guidelines/code-clarity.md +18 -0
- package/package.json +1 -1
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +6 -6
- package/src/agent-src/scripts/guarded_baseline.ts +22 -7
- package/src/agent-src/scripts/stubs_due.ts +118 -2
- package/src/agent-src/scripts/update_roadmap_progress.ts +8 -8
- package/src/config/assurance-capability-registry.json +1 -1
- package/src/config/estate-count-budget.json +20 -1
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-coverage.yml +211 -1
- package/src/config/gate-reachability-exemptions.json +1 -0
- package/src/config/gate-violation-baselines.json +9 -3
- package/src/config/preamble-payload-budget.json +19 -11
- package/src/config/rule-stub-ceilings.json +14 -7
- package/src/config/web-launch-readiness.json +4 -2
- package/src/scripts/_cli/_doctor_emit.ts +71 -0
- package/src/scripts/_cli/_doctor_strict.ts +163 -0
- package/src/scripts/_cli/cmd_doctor.ts +16 -37
- package/src/scripts/_dispatch.bash +11 -4
- package/src/scripts/_lib/activation_ladder.ts +47 -3
- package/src/scripts/_lib/activation_receipt_producer.ts +341 -0
- package/src/scripts/_lib/adr_frontmatter.ts +26 -0
- package/src/scripts/_lib/branch_convergence.ts +186 -0
- package/src/scripts/_lib/candidate_pair_delta.ts +349 -0
- package/src/scripts/_lib/carrier_status.ts +118 -0
- package/src/scripts/_lib/cascade_stage_enumeration.ts +92 -0
- package/src/scripts/_lib/context_observation.ts +132 -0
- package/src/scripts/_lib/continuation_ladder.ts +188 -0
- package/src/scripts/_lib/corpus_manifest.ts +726 -0
- package/src/scripts/_lib/delivery_arm_experiment.ts +18 -2
- package/src/scripts/_lib/estate_carrier_cases.ts +72 -0
- package/src/scripts/_lib/evaluation_cascade.ts +452 -0
- package/src/scripts/_lib/evolution_roi.ts +562 -0
- package/src/scripts/_lib/experiment_binding.ts +95 -0
- package/src/scripts/_lib/harness_evolution_guards.ts +10 -0
- package/src/scripts/_lib/ignored_blocker.ts +8 -1
- package/src/scripts/_lib/lexical_shortlist.ts +215 -0
- package/src/scripts/_lib/llm_candidate_proposer.ts +461 -0
- package/src/scripts/_lib/llm_proposer_transport.ts +153 -0
- package/src/scripts/_lib/outcome_envelope.ts +6 -1
- package/src/scripts/_lib/outcome_vocabularies.ts +135 -5
- package/src/scripts/_lib/pathology_archive.ts +393 -0
- package/src/scripts/_lib/promotion_capability.ts +315 -0
- package/src/scripts/_lib/promotion_evidence.ts +414 -0
- package/src/scripts/_lib/promotion_review.ts +294 -0
- package/src/scripts/_lib/prompt_shape.ts +92 -0
- package/src/scripts/_lib/release_highlights.ts +79 -1
- package/src/scripts/_lib/release_material.ts +125 -2
- package/src/scripts/_lib/repeated_failure.ts +19 -2
- package/src/scripts/_lib/routing_corpus.ts +307 -0
- package/src/scripts/_lib/routing_index_input.ts +104 -0
- package/src/scripts/_lib/rule_injection.ts +22 -1
- package/src/scripts/_lib/runtime_journal.ts +11 -4
- package/src/scripts/_lib/semantic_noop.ts +167 -0
- package/src/scripts/activation_receipt.ts +258 -0
- package/src/scripts/ai_council/cross_exam.ts +128 -0
- package/src/scripts/ai_council/explain_route.ts +157 -0
- package/src/scripts/ai_council/information_gain.ts +293 -0
- package/src/scripts/ai_council/leakage_corpus.ts +385 -0
- package/src/scripts/ai_council/leakage_patterns.ts +453 -0
- package/src/scripts/ai_council/minority_retention.ts +171 -0
- package/src/scripts/ai_council/recouncil_savings.ts +299 -0
- package/src/scripts/ai_council/replay_route.ts +223 -0
- package/src/scripts/ai_council/reviewer_assignment.ts +279 -0
- package/src/scripts/ai_council/routing_training_row.ts +197 -0
- package/src/scripts/ai_council/synthesis_strategy.ts +159 -0
- package/src/scripts/check_adr_frontmatter.ts +4 -9
- package/src/scripts/check_agent_artifact_location.ts +337 -0
- package/src/scripts/check_artefact_count_messaging.ts +74 -8
- package/src/scripts/check_enforcement_coverage.ts +40 -1
- package/src/scripts/check_estate_count.ts +205 -24
- package/src/scripts/check_release_highlights.ts +113 -14
- package/src/scripts/check_roadmap_trackable.ts +17 -2
- package/src/scripts/check_web_launch_readiness.ts +310 -20
- package/src/scripts/corpus_manifest.ts +235 -0
- package/src/scripts/evolution_lab.ts +234 -9
- package/src/scripts/generate_capability_matrix.ts +16 -9
- package/src/scripts/grade_target_readiness.ts +221 -2
- package/src/scripts/hook_effect_doctor.ts +47 -4
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +28 -6
- package/src/scripts/hooks/comment_discipline_hook.ts +146 -0
- package/src/scripts/hooks/concern_registry.ts +2 -0
- package/src/scripts/hooks/run_continuation_hook.ts +78 -88
- package/src/scripts/hooks/session_eol_hook.ts +12 -1
- package/src/scripts/hooks/turn_end_gate_hook.ts +9 -1
- package/src/scripts/install-hooks.sh +18 -0
- package/src/scripts/language_mirror_hook.ts +14 -2
- package/src/scripts/lint_carrier_integrity.ts +820 -0
- package/src/scripts/lint_code_comments.ts +748 -0
- package/src/scripts/lint_plan_risk_register.ts +39 -19
- package/src/scripts/lint_promotion_paths.ts +779 -0
- package/src/scripts/llm_propose.ts +256 -0
- package/src/scripts/measure_delivery_sets.ts +361 -0
- package/src/scripts/measure_routing_signal.ts +307 -0
- package/src/scripts/model_rule_injection.ts +19 -3
- package/src/scripts/probe_council_retention.ts +495 -0
- package/src/scripts/release.ts +21 -37
- package/src/scripts/release_drill.ts +199 -0
- package/src/scripts/release_env.ts +35 -0
- package/src/scripts/release_publication.ts +142 -0
- package/src/scripts/roadmap_context.ts +15 -0
- package/src/scripts/skill_scout.ts +633 -0
- package/src/scripts/sync_pr_branch.ts +521 -42
|
@@ -105,11 +105,18 @@ export interface JournalConsumptionRow {
|
|
|
105
105
|
* cannot drift: if this string and {@link rowIsIgnoredBlocker} ever disagree,
|
|
106
106
|
* the disagreement is visible in one file. It is a documented query shape, not
|
|
107
107
|
* a live query — nothing in this module opens a database.
|
|
108
|
+
*
|
|
109
|
+
* The `IN` list is DERIVED from {@link NON_SUCCESS_STATES}, not written out.
|
|
110
|
+
* It used to be four hand-typed literals, and "kept beside the predicate so the
|
|
111
|
+
* two cannot drift" was true of the FILE and false of the LIST: when the run
|
|
112
|
+
* vocabulary gained a seventh state (`road-to-wired-instruments` 2.3) the
|
|
113
|
+
* predicate picked it up from the set and this string did not, so the same
|
|
114
|
+
* module answered its own question two ways. Co-location is not a binding.
|
|
108
115
|
*/
|
|
109
116
|
export const IGNORED_BLOCKER_QUERY = `
|
|
110
117
|
SELECT episode_id, state, suggestion
|
|
111
118
|
FROM journal_events
|
|
112
|
-
WHERE state IN (
|
|
119
|
+
WHERE state IN (${[...NON_SUCCESS_STATES].map((s) => `'${s}'`).join(', ')})
|
|
113
120
|
AND consumption IS NULL
|
|
114
121
|
ORDER BY episode_id
|
|
115
122
|
`.trim();
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lexical shortlist over the existing BM25 core — a SHORTLIST, never a decider.
|
|
3
|
+
*
|
|
4
|
+
* `road-to-governed-harness-evolution` Phase 6, step 6.3.
|
|
5
|
+
*
|
|
6
|
+
* > *6.3 Only then consider a lexical shortlist, and only as a shortlist. Over
|
|
7
|
+
* > the existing BM25 core. No embeddings […]. The skipped parent proposed the
|
|
8
|
+
* > shortlist and explicitly refused it as final truth.*
|
|
9
|
+
* > verify: **the shortlist feeds a later stage and never decides alone.**
|
|
10
|
+
*
|
|
11
|
+
* ## No embeddings, and the citation this step carried had moved
|
|
12
|
+
*
|
|
13
|
+
* The step's own text cites `docs/contracts/no-runtime-boundary.md:40` for the
|
|
14
|
+
* classification. That file is now a **superseded pointer** (ADR-249,
|
|
15
|
+
* 2026-08-27) and line 40 no longer says it. The substance survived the move
|
|
16
|
+
* intact and is quoted from its live home instead:
|
|
17
|
+
* `docs/contracts/resident-process-governance.md:82` — *"A code-graph cache
|
|
18
|
+
* passes; a vector index fails"*, under the P3 state-store test, with P4
|
|
19
|
+
* separately prohibiting any index build requiring network or model calls.
|
|
20
|
+
* So this module builds over `_lib/lexical_index.ts` — hand-rolled BM25, pure
|
|
21
|
+
* Node stdlib, the core ADR-061 already sanctions. A static scan in
|
|
22
|
+
* `tests/scripts/_lib/lexical_shortlist.test.ts` asserts this module and that
|
|
23
|
+
* core reach no embedding construct, no vector store and no model call. The
|
|
24
|
+
* construct list lives in the test rather than here for a mechanical reason:
|
|
25
|
+
* a scanner whose banned literals sit in the file it scans matches its own
|
|
26
|
+
* declaration and can never pass — the same reason
|
|
27
|
+
* `tests/scripts/governed_harness_no_live_harness.test.ts` keeps its banned set
|
|
28
|
+
* on the test side.
|
|
29
|
+
*
|
|
30
|
+
* ## "Never decides alone", made mechanical rather than promised
|
|
31
|
+
*
|
|
32
|
+
* A shortlist decides alone in exactly two ways, and both are closed here by
|
|
33
|
+
* construction rather than by a caller's discipline:
|
|
34
|
+
*
|
|
35
|
+
* 1. **By addition** — delivering something the authoritative matcher did not
|
|
36
|
+
* fire on. Impossible: {@link orderByShortlist} takes the matcher's output
|
|
37
|
+
* as its input domain and returns a PERMUTATION of it. Ids the shortlist
|
|
38
|
+
* ranks that the matcher did not return are dropped on the floor, and
|
|
39
|
+
* {@link selectForInjection}'s tie-break argument is consulted only to
|
|
40
|
+
* order ids that are already in `matches`.
|
|
41
|
+
* 2. **By subtraction** — silently removing a matcher hit, which is a
|
|
42
|
+
* decision dressed as a filter. Impossible: the same permutation
|
|
43
|
+
* invariant. {@link ShortlistDecidedAloneError} is thrown when the output
|
|
44
|
+
* id multiset differs from the input's in either direction, so a future
|
|
45
|
+
* edit that turns the reordering into a filter fails loudly instead of
|
|
46
|
+
* quietly losing recall.
|
|
47
|
+
*
|
|
48
|
+
* The shortlist's actual job is the third thing, and it is a real one: when the
|
|
49
|
+
* per-prompt byte cap BINDS, something has to choose which matched bodies
|
|
50
|
+
* survive it. Today that is the matcher's trigger-hit count and then router
|
|
51
|
+
* declaration order — and the hit count is a coarse integer on which most rules
|
|
52
|
+
* tie, so the surviving set is decided by declaration order, which is not a
|
|
53
|
+
* relevance signal at all. The shortlist supplies one, subordinate to the
|
|
54
|
+
* matcher score and never above it.
|
|
55
|
+
*
|
|
56
|
+
* ## Subordination is an ORDER of comparison keys, and the order is the contract
|
|
57
|
+
*
|
|
58
|
+
* `score desc → shortlist rank → router order`. The matcher's verdict is read
|
|
59
|
+
* first and the shortlist only breaks its ties. Promoting the shortlist above
|
|
60
|
+
* `score` would let a lexically-similar rule outrank one the matcher fired on
|
|
61
|
+
* twice, which is the shortlist deciding — a test pins the key order and is
|
|
62
|
+
* proved to go red when it is inverted.
|
|
63
|
+
*
|
|
64
|
+
* ## What this module does NOT claim
|
|
65
|
+
*
|
|
66
|
+
* That the shortlist improves anything. Whether a lexical tie-break beats
|
|
67
|
+
* declaration order under a binding cap is a MEASUREMENT, and step 6.4 is where
|
|
68
|
+
* the loss ceiling for it gets pre-registered. `model_rule_injection
|
|
69
|
+
* --three-arm --shortlist` runs the arm with it, default OFF, so 6.1's recorded
|
|
70
|
+
* figures are reproducible unchanged.
|
|
71
|
+
*/
|
|
72
|
+
import { LexicalIndex, type IndexDoc } from './lexical_index.js';
|
|
73
|
+
import { allTierRules, loadRuleBody, type Router, type TierRuleMatch } from './rule_injection.js';
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* How many ids a shortlist may carry.
|
|
77
|
+
*
|
|
78
|
+
* A STATED default, not a measured optimum, and deliberately generous: this
|
|
79
|
+
* shortlist narrows nothing (it reorders), so `k` bounds only how far down the
|
|
80
|
+
* BM25 ranking a tie-break signal is available before router order takes over.
|
|
81
|
+
* Revisit-if 6.4 measures a cap-drop the shortlist could have prevented at a
|
|
82
|
+
* rank beyond it.
|
|
83
|
+
*/
|
|
84
|
+
export const SHORTLIST_SIZE = 40;
|
|
85
|
+
|
|
86
|
+
export class ShortlistDecidedAloneError extends Error {
|
|
87
|
+
constructor(message: string) {
|
|
88
|
+
super(message);
|
|
89
|
+
this.name = 'ShortlistDecidedAloneError';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Index every tier rule that has a projected body.
|
|
95
|
+
*
|
|
96
|
+
* Kernel rules are excluded for the same reason `_lib/rule_injection.ts`
|
|
97
|
+
* excludes them from injection: they are standing context by definition, so
|
|
98
|
+
* they are never candidates for a cap that only ever binds on injected bodies.
|
|
99
|
+
* `allTierRules` already returns the non-kernel set.
|
|
100
|
+
*/
|
|
101
|
+
export function buildRuleIndex(repoRoot: string, router: Router): LexicalIndex {
|
|
102
|
+
const docs: IndexDoc[] = [];
|
|
103
|
+
for (const r of allTierRules(router)) {
|
|
104
|
+
const body = loadRuleBody(repoRoot, r.id);
|
|
105
|
+
if (body === null) continue;
|
|
106
|
+
// The id is joined into the text on purpose: a rule's own name is the
|
|
107
|
+
// single most reliable lexical signal it carries, and hyphenated ids
|
|
108
|
+
// tokenise into exactly the words a prompt about that rule would use.
|
|
109
|
+
docs.push({ id: r.id, text: `${r.id.split('-').join(' ')}\n${body}` });
|
|
110
|
+
}
|
|
111
|
+
return new LexicalIndex(docs);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The ranked shortlist for one prompt. BM25 only; no model call, no embedding.
|
|
116
|
+
*
|
|
117
|
+
* Returns ids in descending relevance, capped at `k`. An empty result is a real
|
|
118
|
+
* answer — it means no indexed body shares a scoring term with the prompt, and
|
|
119
|
+
* the caller then falls back to router order exactly as it does today.
|
|
120
|
+
*/
|
|
121
|
+
export function shortlistIds(
|
|
122
|
+
index: LexicalIndex,
|
|
123
|
+
prompt: string,
|
|
124
|
+
k: number = SHORTLIST_SIZE,
|
|
125
|
+
): string[] {
|
|
126
|
+
if (k <= 0) return [];
|
|
127
|
+
return index.rank([prompt]).slice(0, k).map((r) => r.id);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Rank lookup: id → position in the shortlist, or `Infinity` for absent.
|
|
132
|
+
*
|
|
133
|
+
* `Infinity` rather than a large integer so an unshortlisted id can never sort
|
|
134
|
+
* above a shortlisted one by arithmetic accident.
|
|
135
|
+
*/
|
|
136
|
+
export function shortlistRanks(ranked: readonly string[]): Map<string, number> {
|
|
137
|
+
const m = new Map<string, number>();
|
|
138
|
+
for (const [i, id] of ranked.entries()) {
|
|
139
|
+
if (!m.has(id)) m.set(id, i);
|
|
140
|
+
}
|
|
141
|
+
return m;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Reorder the matcher's output by the shortlist — a PERMUTATION, always.
|
|
146
|
+
*
|
|
147
|
+
* This is the function that makes "never decides alone" checkable. It takes the
|
|
148
|
+
* matcher's verdict as its input domain, applies the same key order
|
|
149
|
+
* {@link selectForInjection} applies (`score desc → shortlist rank → router
|
|
150
|
+
* order`), and REFUSES to return anything whose id multiset differs from what
|
|
151
|
+
* it was given.
|
|
152
|
+
*
|
|
153
|
+
* @throws {ShortlistDecidedAloneError} when the result would add or drop an id.
|
|
154
|
+
*/
|
|
155
|
+
export function orderByShortlist(
|
|
156
|
+
matches: readonly TierRuleMatch[],
|
|
157
|
+
ranked: readonly string[],
|
|
158
|
+
): TierRuleMatch[] {
|
|
159
|
+
const rank = shortlistRanks(ranked);
|
|
160
|
+
const out = [...matches].sort(
|
|
161
|
+
(a, b) =>
|
|
162
|
+
b.score - a.score ||
|
|
163
|
+
(rank.get(a.id) ?? Infinity) - (rank.get(b.id) ?? Infinity) ||
|
|
164
|
+
a.order - b.order,
|
|
165
|
+
);
|
|
166
|
+
assertPermutation(matches, out);
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Same-multiset assertion, in both directions. Exported so a test can drive it. */
|
|
171
|
+
export function assertPermutation(
|
|
172
|
+
before: readonly TierRuleMatch[],
|
|
173
|
+
after: readonly TierRuleMatch[],
|
|
174
|
+
): void {
|
|
175
|
+
const count = (xs: readonly TierRuleMatch[]): Map<string, number> => {
|
|
176
|
+
const m = new Map<string, number>();
|
|
177
|
+
for (const x of xs) m.set(x.id, (m.get(x.id) ?? 0) + 1);
|
|
178
|
+
return m;
|
|
179
|
+
};
|
|
180
|
+
const a = count(before);
|
|
181
|
+
const b = count(after);
|
|
182
|
+
const added: string[] = [];
|
|
183
|
+
const dropped: string[] = [];
|
|
184
|
+
for (const [id, n] of b) {
|
|
185
|
+
if ((a.get(id) ?? 0) < n) added.push(id);
|
|
186
|
+
}
|
|
187
|
+
for (const [id, n] of a) {
|
|
188
|
+
if ((b.get(id) ?? 0) < n) dropped.push(id);
|
|
189
|
+
}
|
|
190
|
+
if (added.length > 0 || dropped.length > 0) {
|
|
191
|
+
throw new ShortlistDecidedAloneError(
|
|
192
|
+
'the shortlist changed the matcher`s set instead of ordering it' +
|
|
193
|
+
(added.length > 0 ? ` — added ${added.sort().join(', ')}` : '') +
|
|
194
|
+
(dropped.length > 0 ? ` — dropped ${dropped.sort().join(', ')}` : '') +
|
|
195
|
+
'. A shortlist that adds delivers what the matcher never fired on; one that ' +
|
|
196
|
+
'drops decides by subtraction. Both are the shortlist deciding alone.',
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A per-prompt shortlist function, bound to one repo root and router.
|
|
203
|
+
*
|
|
204
|
+
* The index is built ONCE and reused for every prompt — building it per prompt
|
|
205
|
+
* would make the cheap stage the expensive one, which is the opposite of what a
|
|
206
|
+
* shortlist is for.
|
|
207
|
+
*/
|
|
208
|
+
export function makePromptShortlist(
|
|
209
|
+
repoRoot: string,
|
|
210
|
+
router: Router,
|
|
211
|
+
k: number = SHORTLIST_SIZE,
|
|
212
|
+
): (prompt: string) => readonly string[] {
|
|
213
|
+
const index = buildRuleIndex(repoRoot, router);
|
|
214
|
+
return (prompt: string) => shortlistIds(index, prompt, k);
|
|
215
|
+
}
|