@event4u/agent-config 9.12.0 → 9.13.0
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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +80 -256
- package/README.md +1 -1
- package/dist/agent-src/rules/active-remediation.md +0 -2
- package/dist/agent-src/rules/architecture.md +0 -1
- package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -4
- package/dist/agent-src/rules/autonomous-execution.md +1 -2
- package/dist/agent-src/rules/broken-access-control.md +0 -2
- package/dist/agent-src/rules/code-comment-discipline.md +0 -3
- package/dist/agent-src/rules/code-provenance.md +0 -3
- package/dist/agent-src/rules/communication-through-line.md +2 -3
- package/dist/agent-src/rules/content-quoting-floor.md +0 -2
- package/dist/agent-src/rules/context-hygiene.md +1 -3
- package/dist/agent-src/rules/decision-revisit-gate.md +0 -2
- package/dist/agent-src/rules/design-fidelity.md +29 -0
- package/dist/agent-src/rules/domain-adoption-policy.md +0 -3
- package/dist/agent-src/rules/downstream-changes.md +10 -1
- package/dist/agent-src/rules/external-reference-deep-dive.md +0 -7
- package/dist/agent-src/rules/fast-path-marker-visibility.md +0 -1
- package/dist/agent-src/rules/git-history-discipline.md +0 -7
- package/dist/agent-src/rules/guidelines.md +0 -2
- package/dist/agent-src/rules/improve-before-implement.md +4 -2
- package/dist/agent-src/rules/invite-challenge.md +0 -4
- package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -2
- package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
- package/dist/agent-src/rules/minimal-safe-diff.md +2 -2
- package/dist/agent-src/rules/missing-tool-handling.md +0 -1
- package/dist/agent-src/rules/no-attribution-footers.md +0 -3
- package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +8 -5
- package/dist/agent-src/rules/no-pr-progress-comments.md +1 -3
- package/dist/agent-src/rules/no-roadmap-references.md +0 -2
- package/dist/agent-src/rules/output-discipline.md +0 -1
- package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -2
- package/dist/agent-src/rules/preservation-guard.md +0 -3
- package/dist/agent-src/rules/role-mode-adherence.md +0 -1
- package/dist/agent-src/rules/secret-vcs-guard.md +0 -2
- package/dist/agent-src/rules/senior-engineering-discipline.md +0 -2
- package/dist/agent-src/rules/session-canary.md +0 -2
- package/dist/agent-src/rules/size-enforcement.md +0 -5
- package/dist/agent-src/rules/source-confidentiality.md +0 -3
- package/dist/agent-src/rules/source-discovery-gate.md +0 -2
- package/dist/agent-src/rules/think-before-action.md +3 -3
- package/dist/agent-src/rules/token-budget-discipline.md +0 -1
- package/dist/agent-src/rules/token-efficiency.md +1 -2
- package/dist/agent-src/rules/tool-safety.md +0 -1
- package/dist/agent-src/rules/user-interaction.md +0 -3
- package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
- package/dist/agent-src/skills/agent-docs-writing/SKILL.md +8 -0
- package/dist/agent-src/skills/analysis-skill-router/SKILL.md +55 -86
- package/dist/agent-src/skills/character-consistency/SKILL.md +7 -4
- package/dist/agent-src/skills/decision-record/SKILL.md +8 -0
- package/dist/agent-src/skills/design-review/SKILL.md +11 -0
- package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +8 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +34 -3
- package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
- package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -4
- package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +201 -0
- package/dist/agent-src/skills/performance/SKILL.md +14 -0
- package/dist/agent-src/skills/pixar-storyteller/SKILL.md +8 -5
- package/dist/agent-src/skills/scene-expander/SKILL.md +9 -6
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +10 -0
- package/dist/agent-src/skills/universal-project-analysis/SKILL.md +14 -37
- package/dist/agent-src/skills/video-director/SKILL.md +9 -6
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
- package/dist/agent-src/templates/scripts/work_engine/state.ts +55 -0
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +89 -67
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -3
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +6 -5
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +5 -4
- package/dist/hooks/dispatch.js +174 -13
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +750 -507
- package/dist/router.json +1 -1
- package/dist/scripts/condense.js +2 -2
- package/docs/MIGRATION.md +1 -1
- package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +71 -0
- package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +24 -1
- package/docs/guidelines/code-clarity.md +9 -2
- package/docs/guidelines/design-fidelity-mechanics.md +44 -0
- package/llms.txt +63 -27
- package/package.json +4 -4
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
- package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
- package/src/agent-src/templates/scripts/work_engine/state.ts +55 -0
- package/src/config/agent-settings.template.yml +8 -0
- package/src/scripts/_lib/counted_probe.ts +142 -0
- package/src/scripts/_lib/overbuild_lens_contract.ts +196 -0
- package/src/scripts/_lib/release_scope.ts +207 -0
- package/src/scripts/ai_council/stance_tally.ts +37 -2
- package/src/scripts/audit_auto_rules.ts +9 -9
- package/src/scripts/audit_likelihood.ts +3 -3
- package/src/scripts/audit_overlap.ts +2 -2
- package/src/scripts/audit_skill_overlap.ts +233 -95
- package/src/scripts/audit_skill_overlap_allowlist.json +4 -0
- package/src/scripts/build_proof.ts +15 -1
- package/src/scripts/check_dependency_floors.ts +16 -6
- package/src/scripts/check_gate_coverage.ts +6 -6
- package/src/scripts/check_kernel_rule_bundle.ts +5 -4
- package/src/scripts/check_token_quality_golden.ts +0 -18
- package/src/scripts/code_graph/loader.ts +35 -6
- package/src/scripts/compile_router.ts +3 -8
- package/src/scripts/condense.ts +2 -2
- package/src/scripts/explain_run.ts +0 -1
- package/src/scripts/generate_pack_manifests.ts +3 -20
- package/src/scripts/hooks/block_kernel_rule_writes.ts +145 -10
- package/src/scripts/hooks/block_no_verify.ts +101 -0
- package/src/scripts/lint_agent_security.ts +5 -4
- package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
- package/src/scripts/lint_regression.ts +92 -1
- package/src/scripts/lint_skill_descriptions.ts +93 -5
- package/src/scripts/project_thin_rules.ts +2 -2
- package/src/scripts/release.ts +107 -3
- package/src/scripts/resolve_lint_scope.ts +53 -0
- package/src/scripts/router_telemetry.ts +0 -5
- package/src/scripts/runtime_dispatcher.ts +40 -0
- package/src/scripts/schemas/pack.schema.json +1 -5
- package/src/scripts/schemas/rule.schema.json +1 -2
- package/src/scripts/self_review_gate.ts +15 -73
- package/src/scripts/skill_linter.ts +93 -11
- package/src/scripts/sweep_dead_scan_roots.ts +550 -0
- package/src/scripts/trigger_coverage.ts +11 -37
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
* 2 = errors
|
|
31
31
|
* 3 = internal error / structural malice
|
|
32
32
|
*/
|
|
33
|
-
import { spawnSync } from 'node:child_process';
|
|
34
33
|
import * as fs from 'node:fs';
|
|
35
34
|
import * as path from 'node:path';
|
|
36
35
|
import process from 'node:process';
|
|
@@ -44,6 +43,9 @@ import {
|
|
|
44
43
|
type YamlValue,
|
|
45
44
|
} from './validate_frontmatter.js';
|
|
46
45
|
import { artefact_roots, resolve_logical } from './_lib/agent_src.js';
|
|
46
|
+
import { ProbeOverflowError, runCountedProbe } from './_lib/counted_probe.js';
|
|
47
|
+
import { resolveContentLintScope } from './_lib/release_scope.js';
|
|
48
|
+
import { DeadScopeError, assertScanned } from './_lib/scan_scope.js';
|
|
47
49
|
|
|
48
50
|
// __file__ equivalent for repo-root derivation (mirrors Python
|
|
49
51
|
// `Path(__file__).resolve().parent.parent.parent` = <repo>/src/scripts → repo).
|
|
@@ -166,10 +168,10 @@ const DOUBLE_BLANK_PATTERN = /\n{3,}/;
|
|
|
166
168
|
const VALID_RULE_TYPES = new Set(['always', 'auto', 'manual']);
|
|
167
169
|
const VALID_RULE_SOURCES = new Set(['package', 'project']);
|
|
168
170
|
|
|
171
|
+
// `intent` was removed — see compile_router.ts's copy of this allowlist.
|
|
169
172
|
const ROUTER_ALLOWED_TRIGGER_KEYS = new Set([
|
|
170
173
|
'keyword',
|
|
171
174
|
'phrase',
|
|
172
|
-
'intent',
|
|
173
175
|
'file_pattern',
|
|
174
176
|
'path_prefix',
|
|
175
177
|
'command',
|
|
@@ -2428,20 +2430,42 @@ export function gather_candidate_files_under(srcRoot: string): string[] {
|
|
|
2428
2430
|
return sortedUnique(out);
|
|
2429
2431
|
}
|
|
2430
2432
|
|
|
2431
|
-
|
|
2433
|
+
/**
|
|
2434
|
+
* The scope `--changed` resolved, for the caller to report.
|
|
2435
|
+
*
|
|
2436
|
+
* Exported alongside the file list because a release PR silently widening its
|
|
2437
|
+
* own scope would be as opaque as the blindness it fixes — the caller prints
|
|
2438
|
+
* this line.
|
|
2439
|
+
*/
|
|
2440
|
+
export let last_changed_scope_reason = '';
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* Candidate files changed against the resolved base.
|
|
2444
|
+
*
|
|
2445
|
+
* The base is release-aware (`_lib/release_scope.ts`): on a release PR it
|
|
2446
|
+
* widens to `previous_release_tag...HEAD`, because a release PR's own diff is
|
|
2447
|
+
* the version bump and the changelog — everything substantive landed in the
|
|
2448
|
+
* commits before the cut. Scoped to the PR's own file list this returned
|
|
2449
|
+
* nothing on a 179-commit release, and the gate reported
|
|
2450
|
+
* "0 skills checked, INCONCLUSIVE" and passed.
|
|
2451
|
+
*
|
|
2452
|
+
* `since` pins the base explicitly and wins over detection.
|
|
2453
|
+
*/
|
|
2454
|
+
export function gather_changed_candidate_files(root: string, since?: string | null): string[] {
|
|
2455
|
+
const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
|
|
2456
|
+
last_changed_scope_reason = scope.reason;
|
|
2432
2457
|
const diffCommands = [
|
|
2433
|
-
['git', 'diff', '--name-only',
|
|
2458
|
+
['git', 'diff', '--name-only', `${scope.base}...HEAD`],
|
|
2434
2459
|
['git', 'diff', '--name-only', '--cached', 'HEAD'],
|
|
2435
2460
|
['git', 'diff', '--name-only', 'HEAD'],
|
|
2436
2461
|
];
|
|
2437
2462
|
try {
|
|
2438
2463
|
let rawLines: string[] = [];
|
|
2439
2464
|
for (const cmd of diffCommands) {
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
if (result.status === 0 && (result.stdout ?? '').trim()) {
|
|
2465
|
+
// A truncated diff would silently shrink the change set — the same
|
|
2466
|
+
// degrade-to-zero shape this roadmap closes elsewhere.
|
|
2467
|
+
const result = runCountedProbe(cmd[0] as string, cmd.slice(1), { cwd: root });
|
|
2468
|
+
if (result.ok && result.stdout.trim()) {
|
|
2445
2469
|
rawLines = splitlines(result.stdout);
|
|
2446
2470
|
break;
|
|
2447
2471
|
}
|
|
@@ -2479,7 +2503,15 @@ export function gather_changed_candidate_files(root: string): string[] {
|
|
|
2479
2503
|
}
|
|
2480
2504
|
}
|
|
2481
2505
|
return sortedUnique(files);
|
|
2482
|
-
} catch {
|
|
2506
|
+
} catch (exc) {
|
|
2507
|
+
// An overflowed diff is not an empty diff. Everything else (a shallow
|
|
2508
|
+
// clone with no `origin/main`, a detached worktree) legitimately has no
|
|
2509
|
+
// resolvable change set and keeps the historical empty-list degrade.
|
|
2510
|
+
if (exc instanceof ProbeOverflowError) {
|
|
2511
|
+
throw exc;
|
|
2512
|
+
}
|
|
2513
|
+
last_changed_scope_reason =
|
|
2514
|
+
`change set unresolvable (${exc instanceof Error ? exc.message : String(exc)})`;
|
|
2483
2515
|
return [];
|
|
2484
2516
|
}
|
|
2485
2517
|
}
|
|
@@ -4082,6 +4114,8 @@ interface Args {
|
|
|
4082
4114
|
report: boolean;
|
|
4083
4115
|
repoRoot: string;
|
|
4084
4116
|
quiet: boolean;
|
|
4117
|
+
/** Explicit diff base for `--changed`; wins over release detection. */
|
|
4118
|
+
since: string | null;
|
|
4085
4119
|
}
|
|
4086
4120
|
|
|
4087
4121
|
export function parse_args(argv: string[]): Args {
|
|
@@ -4095,6 +4129,7 @@ export function parse_args(argv: string[]): Args {
|
|
|
4095
4129
|
condensationQuality: false,
|
|
4096
4130
|
strictWarnings: false,
|
|
4097
4131
|
report: false,
|
|
4132
|
+
since: null,
|
|
4098
4133
|
repoRoot: '.',
|
|
4099
4134
|
quiet: false,
|
|
4100
4135
|
};
|
|
@@ -4104,6 +4139,15 @@ export function parse_args(argv: string[]): Args {
|
|
|
4104
4139
|
args.all = true;
|
|
4105
4140
|
} else if (a === '--changed') {
|
|
4106
4141
|
args.changed = true;
|
|
4142
|
+
} else if (a === '--since') {
|
|
4143
|
+
const v = argv[i + 1];
|
|
4144
|
+
i += 1;
|
|
4145
|
+
if (v === undefined || v.startsWith('--')) {
|
|
4146
|
+
throw new ArgError('argument --since: expected a git ref');
|
|
4147
|
+
}
|
|
4148
|
+
args.since = v;
|
|
4149
|
+
} else if (a.startsWith('--since=')) {
|
|
4150
|
+
args.since = a.slice('--since='.length);
|
|
4107
4151
|
} else if (a === '--format') {
|
|
4108
4152
|
const v = argv[i + 1];
|
|
4109
4153
|
i += 1;
|
|
@@ -4143,6 +4187,21 @@ export function parse_args(argv: string[]): Args {
|
|
|
4143
4187
|
|
|
4144
4188
|
class ArgError extends Error {}
|
|
4145
4189
|
|
|
4190
|
+
/**
|
|
4191
|
+
* True when an empty change set is a defect rather than a legitimate scope.
|
|
4192
|
+
*
|
|
4193
|
+
* Only on a release PR whose scope actually widened to a tag span: a release
|
|
4194
|
+
* that changed no skill and no rule is possible in principle, but a *resolved*
|
|
4195
|
+
* span that matched nothing is the "0 skills checked, INCONCLUSIVE" shape this
|
|
4196
|
+
* gate exists to stop. A release whose previous tag could not be resolved is
|
|
4197
|
+
* excluded — that scope never widened, so failing it would punish a shallow
|
|
4198
|
+
* clone for the wrong reason.
|
|
4199
|
+
*/
|
|
4200
|
+
function _release_scope_requires_findings(root: string, since?: string | null): boolean {
|
|
4201
|
+
const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
|
|
4202
|
+
return scope.isRelease && scope.previousTag !== null;
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4146
4205
|
export function main(argv: string[]): number {
|
|
4147
4206
|
let args: Args;
|
|
4148
4207
|
try {
|
|
@@ -4162,7 +4221,8 @@ export function main(argv: string[]): number {
|
|
|
4162
4221
|
paths.push(...gather_all_candidate_files(root));
|
|
4163
4222
|
}
|
|
4164
4223
|
if (args.changed) {
|
|
4165
|
-
paths.push(...gather_changed_candidate_files(root));
|
|
4224
|
+
paths.push(...gather_changed_candidate_files(root, args.since));
|
|
4225
|
+
process.stderr.write(`skill_linter --changed: ${last_changed_scope_reason}\n`);
|
|
4166
4226
|
}
|
|
4167
4227
|
for (const raw of args.paths) {
|
|
4168
4228
|
const p = path.isAbsolute(raw) ? raw : path.resolve(root, raw);
|
|
@@ -4183,6 +4243,28 @@ export function main(argv: string[]): number {
|
|
|
4183
4243
|
} else if (args.format === 'json') {
|
|
4184
4244
|
process.stdout.write(`${format_json([])}\n`);
|
|
4185
4245
|
}
|
|
4246
|
+
// A release PR that resolved a real tag span and still matched
|
|
4247
|
+
// nothing has not passed — it examined nothing. Mirrors the
|
|
4248
|
+
// scan-scope regime the other gates already adopted
|
|
4249
|
+
// (`_lib/scan_scope.ts`; exit 2, as `check_iron_law_prominence`).
|
|
4250
|
+
// Ordinary PRs keep the historical exit 0: a change set with no
|
|
4251
|
+
// skill or rule in it is a legitimate empty scope, not a dead one.
|
|
4252
|
+
if (args.changed && _release_scope_requires_findings(root, args.since)) {
|
|
4253
|
+
try {
|
|
4254
|
+
assertScanned({
|
|
4255
|
+
gate: 'skill_linter --changed (release PR)',
|
|
4256
|
+
scanned: 0,
|
|
4257
|
+
units: 'skill/rule files',
|
|
4258
|
+
roots: [last_changed_scope_reason],
|
|
4259
|
+
});
|
|
4260
|
+
} catch (exc) {
|
|
4261
|
+
if (exc instanceof DeadScopeError) {
|
|
4262
|
+
process.stderr.write(`❌ ${exc.message}\n`);
|
|
4263
|
+
return 2;
|
|
4264
|
+
}
|
|
4265
|
+
throw exc;
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4186
4268
|
process.stderr.write('No matching skill/rule files found.\n');
|
|
4187
4269
|
return 0;
|
|
4188
4270
|
}
|