@attalabs/vinaya 0.33.0 → 0.35.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/LICENSE +104 -201
- package/README.md +1 -1
- package/aeg-root/enforcement.md +1 -1
- package/aeg-root/glossary.md +4 -0
- package/aeg-root/roles/developer.md +3 -0
- package/aeg-root/roles/operator.md +30 -10
- package/aeg-root/roles/planner/reference.md +3 -2
- package/aeg-root/roles/planner.md +3 -1
- package/aeg-root/templates/brief-template.md +9 -7
- package/aeg-root/templates/pr-report-template.md +3 -1
- package/dist/checks/bin/check-body-bare-digits.js +107 -28
- package/dist/checks/bin/check-branch-topology.js +94 -25
- package/dist/checks/bin/check-brief-shape.js +113 -33
- package/dist/checks/bin/check-changeset-coverage.js +369 -92
- package/dist/checks/bin/check-closes-n.js +94 -25
- package/dist/checks/bin/check-coherence.js +124 -29
- package/dist/checks/bin/check-dead-branch-push.js +79 -25
- package/dist/checks/bin/check-dispatch-readiness.js +122 -28
- package/dist/checks/bin/check-doc-coverage-push.js +365 -88
- package/dist/checks/bin/check-doc-coverage.js +367 -90
- package/dist/checks/bin/check-doctrine-no-procedures.js +107 -28
- package/dist/checks/bin/check-doctrine-portability.js +366 -89
- package/dist/checks/bin/check-evidence-fresh.js +338 -61
- package/dist/checks/bin/check-exec-bits.js +363 -86
- package/dist/checks/bin/check-first-push-dispatch.js +122 -28
- package/dist/checks/bin/check-issue-assignment.js +94 -25
- package/dist/checks/bin/check-issue-milestone-attach.js +79 -25
- package/dist/checks/bin/check-issue-objectives-numbering.js +606 -26
- package/dist/checks/bin/check-issue-parts-coverage.js +79 -25
- package/dist/checks/bin/check-issue-surface-globs.js +162 -34
- package/dist/checks/bin/check-issue-title-grammar.js +79 -25
- package/dist/checks/bin/check-issue-tranche-label.js +79 -25
- package/dist/checks/bin/check-main-branch-refusal.js +79 -25
- package/dist/checks/bin/check-no-disk-state.js +79 -25
- package/dist/checks/bin/check-pr-premise-reassert.js +107 -28
- package/dist/checks/bin/check-pr-report-density.js +79 -25
- package/dist/checks/bin/check-principal-test-plan-wait.js +79 -25
- package/dist/checks/bin/check-quoted-command.js +282 -39
- package/dist/checks/bin/check-reader-resolvable-prose.js +333 -47
- package/dist/checks/bin/check-registry-gates.js +79 -25
- package/dist/checks/bin/check-retired-vocabulary.js +282 -39
- package/dist/checks/bin/check-review-gate.js +111 -31
- package/dist/checks/bin/check-single-plan-pr.js +79 -25
- package/dist/checks/bin/check-surface-scope.js +94 -25
- package/dist/checks/bin/check-test-plan.js +79 -25
- package/dist/checks/bin/check-token-collection-wired.js +79 -25
- package/dist/checks/bin/check-token-report.js +79 -25
- package/dist/checks/bin/check-workspace-escape.js +364 -87
- package/dist/index.js +2713 -1609
- package/dist/lib/pre-push-cache-test-run.js +226 -16
- package/dist/lib/pre-push-select-tests.js +48 -5
- package/package.json +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +153 -37
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +87 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +9 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +13 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +7 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +116 -20
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +100 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-cutovers.ts +49 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +60 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +138 -54
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +26 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives-cutover-config.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +15 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +122 -23
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +18 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +24 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +15 -10
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +16 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +194 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +312 -53
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +62 -8
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__18paley._.js → [root-of-the-server]__0zc_0gx._.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_15gdg48._.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{22s44f5k3ecmj.js → 3goaig_rysc6p.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1ce2dj27_cgbj.js → 3ip5z3cf43bgo.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{34hhdtbp20krb.js → 3u9emqjwpd0t9.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bm4nrrzwc7zi.css +0 -1
- /package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_ssgManifest.js +0 -0
|
@@ -193,8 +193,8 @@ function maskIndentedCode(body, fill) {
|
|
|
193
193
|
var SECTION_HEADER = /\*\*Dependency rationale\*\*/i;
|
|
194
194
|
var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
|
|
195
195
|
var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
|
|
196
|
-
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d
|
|
197
|
-
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+
|
|
196
|
+
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+$/i;
|
|
197
|
+
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+)$/i;
|
|
198
198
|
function splitSlugQualifiedEdge(edge) {
|
|
199
199
|
const m = edge.trim().match(SLUG_QUALIFIED_ID);
|
|
200
200
|
if (!m)
|
|
@@ -2615,7 +2615,7 @@ function isIssueNotFoundError(err) {
|
|
|
2615
2615
|
return /could not resolve to an (?:issue|pull request)|\b404\b|not found/i.test(haystack);
|
|
2616
2616
|
}
|
|
2617
2617
|
function resolveObjectivesSource(prBody, issue, cutoverIssue) {
|
|
2618
|
-
if (issue !== null && issue < cutoverIssue)
|
|
2618
|
+
if (issue !== null && cutoverIssue !== null && issue < cutoverIssue)
|
|
2619
2619
|
return { kind: "none" };
|
|
2620
2620
|
if (issue !== null)
|
|
2621
2621
|
return { kind: "issue", issue };
|
|
@@ -2891,9 +2891,18 @@ var COMMIT_TYPES = [
|
|
|
2891
2891
|
];
|
|
2892
2892
|
var COMMIT_TYPE_STYLE = new RegExp(`^(${COMMIT_TYPES.join("|")})(\\([a-z0-9-]+\\))?: \\S`);
|
|
2893
2893
|
function checkForgeTitle(title) {
|
|
2894
|
-
const taskStyle = /^\[[a-z0-9._-]+\] \
|
|
2894
|
+
const taskStyle = /^\[[a-z0-9._-]+\] \d+ — \S/;
|
|
2895
2895
|
if (COMMIT_TYPE_STYLE.test(title) || taskStyle.test(title))
|
|
2896
2896
|
return { status: "pass", errors: [] };
|
|
2897
|
+
const letteredTaskId = /^\[[a-z0-9._-]+\] (\S+) — \S/.exec(title);
|
|
2898
|
+
if (letteredTaskId) {
|
|
2899
|
+
return {
|
|
2900
|
+
status: "fail",
|
|
2901
|
+
errors: [
|
|
2902
|
+
`brief-validation title: "${title}" names task id \`${letteredTaskId[1]}\` — task ids are whole numbers (\`1\`, \`2\`), never lettered (\`2a\`). \`vinaya task run\` and \`task dispatch\` refuse a non-numeric id, so a plan titled this way names a task that cannot be started.`
|
|
2903
|
+
]
|
|
2904
|
+
};
|
|
2905
|
+
}
|
|
2897
2906
|
return {
|
|
2898
2907
|
status: "fail",
|
|
2899
2908
|
errors: [
|
|
@@ -2926,19 +2935,31 @@ function checkNoAgentBoxes(prBody) {
|
|
|
2926
2935
|
]
|
|
2927
2936
|
};
|
|
2928
2937
|
}
|
|
2929
|
-
function
|
|
2938
|
+
function rolloutRuleFor(message) {
|
|
2930
2939
|
if (message.startsWith("brief-validation unpinned code claim:") || message.startsWith("brief-validation commands carry output:") || message.startsWith("brief-validation consumer tests:") || message.startsWith("brief-validation defeat cases:")) {
|
|
2931
|
-
return
|
|
2940
|
+
return "briefRules";
|
|
2932
2941
|
}
|
|
2933
2942
|
if (message.startsWith("brief-validation no agent boxes:"))
|
|
2934
|
-
return
|
|
2943
|
+
return "agentBoxes";
|
|
2944
|
+
return null;
|
|
2945
|
+
}
|
|
2946
|
+
var DEFAULT_BRIEF_ROLLOUT_CUTOVERS = {
|
|
2947
|
+
briefRulesSincePr: BRIEF_RULES_SINCE_PR,
|
|
2948
|
+
agentBoxesRefusedSincePr: AGENT_BOXES_REFUSED_SINCE_PR
|
|
2949
|
+
};
|
|
2950
|
+
function rolloutThresholdFor(message, cutovers) {
|
|
2951
|
+
const rule = rolloutRuleFor(message);
|
|
2952
|
+
if (rule === "briefRules")
|
|
2953
|
+
return cutovers.briefRulesSincePr;
|
|
2954
|
+
if (rule === "agentBoxes")
|
|
2955
|
+
return cutovers.agentBoxesRefusedSincePr;
|
|
2935
2956
|
return null;
|
|
2936
2957
|
}
|
|
2937
|
-
function partitionBriefErrorsByRollout(errors, prNumber) {
|
|
2958
|
+
function partitionBriefErrorsByRollout(errors, prNumber, cutovers = DEFAULT_BRIEF_ROLLOUT_CUTOVERS) {
|
|
2938
2959
|
const blocking = [];
|
|
2939
2960
|
const info = [];
|
|
2940
2961
|
for (const e of errors) {
|
|
2941
|
-
const threshold = rolloutThresholdFor(e);
|
|
2962
|
+
const threshold = rolloutThresholdFor(e, cutovers);
|
|
2942
2963
|
const grandfathered = threshold !== null && prNumber !== null && prNumber < threshold;
|
|
2943
2964
|
(grandfathered ? info : blocking).push(e);
|
|
2944
2965
|
}
|
|
@@ -3406,8 +3427,8 @@ function checkIssueRationale(body) {
|
|
|
3406
3427
|
return { status: errors.length > 0 ? "fail" : "pass", errors };
|
|
3407
3428
|
}
|
|
3408
3429
|
var OBJECTIVES_SINCE_ISSUE = 404;
|
|
3409
|
-
function checkIssueObjectives(body, issueNumber) {
|
|
3410
|
-
if (issueNumber !== null && issueNumber <
|
|
3430
|
+
function checkIssueObjectives(body, issueNumber, sinceIssue = OBJECTIVES_SINCE_ISSUE) {
|
|
3431
|
+
if (sinceIssue !== null && issueNumber !== null && issueNumber < sinceIssue)
|
|
3411
3432
|
return { status: "pass", errors: [] };
|
|
3412
3433
|
const result = objectivesOf(body);
|
|
3413
3434
|
if (result.ok)
|
|
@@ -3483,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3483
3504
|
function globCoversPath(glob, path) {
|
|
3484
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3485
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3486
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3487
3510
|
}
|
|
3488
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3852,7 +3875,7 @@ function resolveDepEntry(dep, trancheSlug, issueToEntry, taskToEntry) {
|
|
|
3852
3875
|
return issueToEntry.get(Number(issueMatch[1]));
|
|
3853
3876
|
return taskToEntry.get(`${trancheSlug}/${dep}`) ?? taskToEntry.get(dep);
|
|
3854
3877
|
}
|
|
3855
|
-
function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
|
|
3878
|
+
function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = [], objectivesSinceIssue) {
|
|
3856
3879
|
const failures = [];
|
|
3857
3880
|
for (const [slug, issues] of issuesBySlug) {
|
|
3858
3881
|
for (const issue of issues) {
|
|
@@ -3861,7 +3884,7 @@ function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
|
|
|
3861
3884
|
const errors = [
|
|
3862
3885
|
...checkIssueRationale(issue.body).errors,
|
|
3863
3886
|
...checkProjectsRegistered(issue.body, issue.labels, registeredNames).errors,
|
|
3864
|
-
...checkIssueObjectives(issue.body, issue.number).errors,
|
|
3887
|
+
...checkIssueObjectives(issue.body, issue.number, objectivesSinceIssue).errors,
|
|
3865
3888
|
...checkPartsCiteDefinedObjectives(issue.body).errors
|
|
3866
3889
|
];
|
|
3867
3890
|
if (errors.length === 0)
|
|
@@ -4484,13 +4507,27 @@ var SHIPS_PREFIX = "aeg-root/";
|
|
|
4484
4507
|
function shipsArchivePrefix(shipsPrefix) {
|
|
4485
4508
|
return `${shipsPrefix}tranches/completed/`;
|
|
4486
4509
|
}
|
|
4487
|
-
|
|
4488
|
-
|
|
4510
|
+
var DEFAULT_SPEC_PATHS = ["SPEC.md", "CONTEXT.md", "docs/adr"];
|
|
4511
|
+
function normalizeSpecPath(entry) {
|
|
4512
|
+
let out = entry.replace(/\\/g, "/");
|
|
4513
|
+
while (out.startsWith("./"))
|
|
4514
|
+
out = out.slice(2);
|
|
4515
|
+
out = out.replace(/\/{2,}/g, "/");
|
|
4516
|
+
while (out.endsWith("/"))
|
|
4517
|
+
out = out.slice(0, -1);
|
|
4518
|
+
return out;
|
|
4519
|
+
}
|
|
4520
|
+
function isSpecFile2(path, specPaths) {
|
|
4521
|
+
if (path.startsWith("apps/") && path.includes("/specs/") && path.endsWith(".md"))
|
|
4522
|
+
return true;
|
|
4523
|
+
if (!path.endsWith(".md"))
|
|
4524
|
+
return false;
|
|
4525
|
+
return specPaths.some((entry) => isUnderOrEqual(path, normalizeSpecPath(entry)));
|
|
4489
4526
|
}
|
|
4490
4527
|
function isClaudeMdFile(path) {
|
|
4491
4528
|
return path === "CLAUDE.md" || path.endsWith("/CLAUDE.md");
|
|
4492
4529
|
}
|
|
4493
|
-
function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX) {
|
|
4530
|
+
function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, specPaths = DEFAULT_SPEC_PATHS) {
|
|
4494
4531
|
if (path.startsWith(shipsPrefix)) {
|
|
4495
4532
|
return path.startsWith(shipsArchivePrefix(shipsPrefix)) ? "internal" : "ships";
|
|
4496
4533
|
}
|
|
@@ -4499,7 +4536,7 @@ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPr
|
|
|
4499
4536
|
}
|
|
4500
4537
|
if (isClaudeMdFile(path))
|
|
4501
4538
|
return "internal";
|
|
4502
|
-
if (isSpecFile2(path))
|
|
4539
|
+
if (isSpecFile2(path, specPaths))
|
|
4503
4540
|
return "spec";
|
|
4504
4541
|
if (isProductScopeFile(path))
|
|
4505
4542
|
return "product";
|
|
@@ -4528,13 +4565,14 @@ function lineAt(content, index) {
|
|
|
4528
4565
|
}
|
|
4529
4566
|
var FORGE_NUMBER_PATTERN = /#[0-9]{2,4}/g;
|
|
4530
4567
|
var TRANCHE_SLUG_VN_PATTERN = /[a-z][a-z-]+-v[0-9]/g;
|
|
4568
|
+
var TASK_NUMBER_PATTERN = /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi;
|
|
4531
4569
|
function legacySlugPattern(legacySlugs) {
|
|
4532
4570
|
if (legacySlugs.length === 0)
|
|
4533
4571
|
return null;
|
|
4534
4572
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
4535
4573
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
4536
4574
|
}
|
|
4537
|
-
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
|
|
4575
|
+
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
4538
4576
|
const findings = [];
|
|
4539
4577
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
4540
4578
|
const grandfathered = new Set(specGrandfather);
|
|
@@ -4546,8 +4584,12 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
4546
4584
|
const productPatterns = [
|
|
4547
4585
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug in product code" }
|
|
4548
4586
|
];
|
|
4587
|
+
const specPatterns = [
|
|
4588
|
+
...patterns,
|
|
4589
|
+
{ pattern: TASK_NUMBER_PATTERN, what: "a task number", group: 2 }
|
|
4590
|
+
];
|
|
4549
4591
|
for (const file of files) {
|
|
4550
|
-
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
|
|
4592
|
+
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, specPaths);
|
|
4551
4593
|
if (!cls || cls === "internal")
|
|
4552
4594
|
continue;
|
|
4553
4595
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
@@ -4556,15 +4598,16 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
4556
4598
|
continue;
|
|
4557
4599
|
const blocking = cls === "product" || cls === "spec";
|
|
4558
4600
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
4559
|
-
const patternsToRun = cls === "product" ? productPatterns : patterns;
|
|
4601
|
+
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
4560
4602
|
for (const { pattern, what, group } of patternsToRun) {
|
|
4561
4603
|
pattern.lastIndex = 0;
|
|
4562
4604
|
let match = pattern.exec(scrubbed);
|
|
4563
4605
|
while (match !== null) {
|
|
4564
4606
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
4607
|
+
const citedIndex = match.index + match[0].indexOf(cited);
|
|
4565
4608
|
findings.push({
|
|
4566
4609
|
file: file.path,
|
|
4567
|
-
line: lineAt(scrubbed,
|
|
4610
|
+
line: lineAt(scrubbed, citedIndex),
|
|
4568
4611
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
4569
4612
|
blocking
|
|
4570
4613
|
});
|
|
@@ -4750,9 +4793,9 @@ function checkSourceComments(files, allowlist = []) {
|
|
|
4750
4793
|
}
|
|
4751
4794
|
return findings;
|
|
4752
4795
|
}
|
|
4753
|
-
function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
|
|
4796
|
+
function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
4754
4797
|
return [
|
|
4755
|
-
...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather),
|
|
4798
|
+
...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather, specPaths),
|
|
4756
4799
|
...checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix)
|
|
4757
4800
|
];
|
|
4758
4801
|
}
|
|
@@ -5217,7 +5260,8 @@ var TaskStatusItemSchema = z.object({
|
|
|
5217
5260
|
}).merge(ObservedSchema);
|
|
5218
5261
|
var TaskStatusResultSchema = z.object({
|
|
5219
5262
|
items: z.array(TaskStatusItemSchema),
|
|
5220
|
-
nextCursor: z.string().nullable()
|
|
5263
|
+
nextCursor: z.string().nullable(),
|
|
5264
|
+
table: z.string()
|
|
5221
5265
|
});
|
|
5222
5266
|
var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
|
|
5223
5267
|
var EscalationInputsSchema = z.object({
|
|
@@ -5561,6 +5605,14 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5561
5605
|
}
|
|
5562
5606
|
return findings;
|
|
5563
5607
|
}
|
|
5608
|
+
// ../../packages/aeg-core/src/gate-cutovers.ts
|
|
5609
|
+
var NO_GATE_CUTOVERS = {
|
|
5610
|
+
objectivesSinceIssue: null,
|
|
5611
|
+
briefSectionsSinceIssue: null,
|
|
5612
|
+
documentationSinceIssue: null,
|
|
5613
|
+
briefRulesSincePr: null,
|
|
5614
|
+
agentBoxesRefusedSincePr: null
|
|
5615
|
+
};
|
|
5564
5616
|
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5565
5617
|
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5566
5618
|
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
@@ -6010,6 +6062,8 @@ function attemptFromEnv(value) {
|
|
|
6010
6062
|
function provenanceFor(input) {
|
|
6011
6063
|
if (input.provenance)
|
|
6012
6064
|
return input.provenance;
|
|
6065
|
+
if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
|
|
6066
|
+
return "unavailable";
|
|
6013
6067
|
if (input.env.role || input.env.task)
|
|
6014
6068
|
return "env_correlated";
|
|
6015
6069
|
return "unavailable";
|
|
@@ -6030,7 +6084,7 @@ function buildHeader(input) {
|
|
|
6030
6084
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6031
6085
|
const round = roundFromEnv(input.env.round);
|
|
6032
6086
|
const subject = {
|
|
6033
|
-
issue: issueFromTask(input.env.task),
|
|
6087
|
+
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6034
6088
|
role,
|
|
6035
6089
|
...round !== undefined ? { round } : {},
|
|
6036
6090
|
...input.subject ?? {}
|
|
@@ -193,8 +193,8 @@ function maskIndentedCode(body, fill) {
|
|
|
193
193
|
var SECTION_HEADER = /\*\*Dependency rationale\*\*/i;
|
|
194
194
|
var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
|
|
195
195
|
var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
|
|
196
|
-
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d
|
|
197
|
-
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+
|
|
196
|
+
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+$/i;
|
|
197
|
+
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+)$/i;
|
|
198
198
|
function splitSlugQualifiedEdge(edge) {
|
|
199
199
|
const m = edge.trim().match(SLUG_QUALIFIED_ID);
|
|
200
200
|
if (!m)
|
|
@@ -2615,7 +2615,7 @@ function isIssueNotFoundError(err) {
|
|
|
2615
2615
|
return /could not resolve to an (?:issue|pull request)|\b404\b|not found/i.test(haystack);
|
|
2616
2616
|
}
|
|
2617
2617
|
function resolveObjectivesSource(prBody, issue, cutoverIssue) {
|
|
2618
|
-
if (issue !== null && issue < cutoverIssue)
|
|
2618
|
+
if (issue !== null && cutoverIssue !== null && issue < cutoverIssue)
|
|
2619
2619
|
return { kind: "none" };
|
|
2620
2620
|
if (issue !== null)
|
|
2621
2621
|
return { kind: "issue", issue };
|
|
@@ -2891,9 +2891,18 @@ var COMMIT_TYPES = [
|
|
|
2891
2891
|
];
|
|
2892
2892
|
var COMMIT_TYPE_STYLE = new RegExp(`^(${COMMIT_TYPES.join("|")})(\\([a-z0-9-]+\\))?: \\S`);
|
|
2893
2893
|
function checkForgeTitle(title) {
|
|
2894
|
-
const taskStyle = /^\[[a-z0-9._-]+\] \
|
|
2894
|
+
const taskStyle = /^\[[a-z0-9._-]+\] \d+ — \S/;
|
|
2895
2895
|
if (COMMIT_TYPE_STYLE.test(title) || taskStyle.test(title))
|
|
2896
2896
|
return { status: "pass", errors: [] };
|
|
2897
|
+
const letteredTaskId = /^\[[a-z0-9._-]+\] (\S+) — \S/.exec(title);
|
|
2898
|
+
if (letteredTaskId) {
|
|
2899
|
+
return {
|
|
2900
|
+
status: "fail",
|
|
2901
|
+
errors: [
|
|
2902
|
+
`brief-validation title: "${title}" names task id \`${letteredTaskId[1]}\` — task ids are whole numbers (\`1\`, \`2\`), never lettered (\`2a\`). \`vinaya task run\` and \`task dispatch\` refuse a non-numeric id, so a plan titled this way names a task that cannot be started.`
|
|
2903
|
+
]
|
|
2904
|
+
};
|
|
2905
|
+
}
|
|
2897
2906
|
return {
|
|
2898
2907
|
status: "fail",
|
|
2899
2908
|
errors: [
|
|
@@ -2926,19 +2935,31 @@ function checkNoAgentBoxes(prBody) {
|
|
|
2926
2935
|
]
|
|
2927
2936
|
};
|
|
2928
2937
|
}
|
|
2929
|
-
function
|
|
2938
|
+
function rolloutRuleFor(message) {
|
|
2930
2939
|
if (message.startsWith("brief-validation unpinned code claim:") || message.startsWith("brief-validation commands carry output:") || message.startsWith("brief-validation consumer tests:") || message.startsWith("brief-validation defeat cases:")) {
|
|
2931
|
-
return
|
|
2940
|
+
return "briefRules";
|
|
2932
2941
|
}
|
|
2933
2942
|
if (message.startsWith("brief-validation no agent boxes:"))
|
|
2934
|
-
return
|
|
2943
|
+
return "agentBoxes";
|
|
2935
2944
|
return null;
|
|
2936
2945
|
}
|
|
2937
|
-
|
|
2946
|
+
var DEFAULT_BRIEF_ROLLOUT_CUTOVERS = {
|
|
2947
|
+
briefRulesSincePr: BRIEF_RULES_SINCE_PR,
|
|
2948
|
+
agentBoxesRefusedSincePr: AGENT_BOXES_REFUSED_SINCE_PR
|
|
2949
|
+
};
|
|
2950
|
+
function rolloutThresholdFor(message, cutovers) {
|
|
2951
|
+
const rule = rolloutRuleFor(message);
|
|
2952
|
+
if (rule === "briefRules")
|
|
2953
|
+
return cutovers.briefRulesSincePr;
|
|
2954
|
+
if (rule === "agentBoxes")
|
|
2955
|
+
return cutovers.agentBoxesRefusedSincePr;
|
|
2956
|
+
return null;
|
|
2957
|
+
}
|
|
2958
|
+
function partitionBriefErrorsByRollout(errors, prNumber, cutovers = DEFAULT_BRIEF_ROLLOUT_CUTOVERS) {
|
|
2938
2959
|
const blocking = [];
|
|
2939
2960
|
const info = [];
|
|
2940
2961
|
for (const e of errors) {
|
|
2941
|
-
const threshold = rolloutThresholdFor(e);
|
|
2962
|
+
const threshold = rolloutThresholdFor(e, cutovers);
|
|
2942
2963
|
const grandfathered = threshold !== null && prNumber !== null && prNumber < threshold;
|
|
2943
2964
|
(grandfathered ? info : blocking).push(e);
|
|
2944
2965
|
}
|
|
@@ -3406,8 +3427,8 @@ function checkIssueRationale(body) {
|
|
|
3406
3427
|
return { status: errors.length > 0 ? "fail" : "pass", errors };
|
|
3407
3428
|
}
|
|
3408
3429
|
var OBJECTIVES_SINCE_ISSUE = 404;
|
|
3409
|
-
function checkIssueObjectives(body, issueNumber) {
|
|
3410
|
-
if (issueNumber !== null && issueNumber <
|
|
3430
|
+
function checkIssueObjectives(body, issueNumber, sinceIssue = OBJECTIVES_SINCE_ISSUE) {
|
|
3431
|
+
if (sinceIssue !== null && issueNumber !== null && issueNumber < sinceIssue)
|
|
3411
3432
|
return { status: "pass", errors: [] };
|
|
3412
3433
|
const result = objectivesOf(body);
|
|
3413
3434
|
if (result.ok)
|
|
@@ -3483,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3483
3504
|
function globCoversPath(glob, path) {
|
|
3484
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3485
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3486
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3487
3510
|
}
|
|
3488
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3852,7 +3875,7 @@ function resolveDepEntry(dep, trancheSlug, issueToEntry, taskToEntry) {
|
|
|
3852
3875
|
return issueToEntry.get(Number(issueMatch[1]));
|
|
3853
3876
|
return taskToEntry.get(`${trancheSlug}/${dep}`) ?? taskToEntry.get(dep);
|
|
3854
3877
|
}
|
|
3855
|
-
function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
|
|
3878
|
+
function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = [], objectivesSinceIssue) {
|
|
3856
3879
|
const failures = [];
|
|
3857
3880
|
for (const [slug, issues] of issuesBySlug) {
|
|
3858
3881
|
for (const issue of issues) {
|
|
@@ -3861,7 +3884,7 @@ function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
|
|
|
3861
3884
|
const errors = [
|
|
3862
3885
|
...checkIssueRationale(issue.body).errors,
|
|
3863
3886
|
...checkProjectsRegistered(issue.body, issue.labels, registeredNames).errors,
|
|
3864
|
-
...checkIssueObjectives(issue.body, issue.number).errors,
|
|
3887
|
+
...checkIssueObjectives(issue.body, issue.number, objectivesSinceIssue).errors,
|
|
3865
3888
|
...checkPartsCiteDefinedObjectives(issue.body).errors
|
|
3866
3889
|
];
|
|
3867
3890
|
if (errors.length === 0)
|
|
@@ -4484,13 +4507,27 @@ var SHIPS_PREFIX = "aeg-root/";
|
|
|
4484
4507
|
function shipsArchivePrefix(shipsPrefix) {
|
|
4485
4508
|
return `${shipsPrefix}tranches/completed/`;
|
|
4486
4509
|
}
|
|
4487
|
-
|
|
4488
|
-
|
|
4510
|
+
var DEFAULT_SPEC_PATHS = ["SPEC.md", "CONTEXT.md", "docs/adr"];
|
|
4511
|
+
function normalizeSpecPath(entry) {
|
|
4512
|
+
let out = entry.replace(/\\/g, "/");
|
|
4513
|
+
while (out.startsWith("./"))
|
|
4514
|
+
out = out.slice(2);
|
|
4515
|
+
out = out.replace(/\/{2,}/g, "/");
|
|
4516
|
+
while (out.endsWith("/"))
|
|
4517
|
+
out = out.slice(0, -1);
|
|
4518
|
+
return out;
|
|
4519
|
+
}
|
|
4520
|
+
function isSpecFile2(path, specPaths) {
|
|
4521
|
+
if (path.startsWith("apps/") && path.includes("/specs/") && path.endsWith(".md"))
|
|
4522
|
+
return true;
|
|
4523
|
+
if (!path.endsWith(".md"))
|
|
4524
|
+
return false;
|
|
4525
|
+
return specPaths.some((entry) => isUnderOrEqual(path, normalizeSpecPath(entry)));
|
|
4489
4526
|
}
|
|
4490
4527
|
function isClaudeMdFile(path) {
|
|
4491
4528
|
return path === "CLAUDE.md" || path.endsWith("/CLAUDE.md");
|
|
4492
4529
|
}
|
|
4493
|
-
function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX) {
|
|
4530
|
+
function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, specPaths = DEFAULT_SPEC_PATHS) {
|
|
4494
4531
|
if (path.startsWith(shipsPrefix)) {
|
|
4495
4532
|
return path.startsWith(shipsArchivePrefix(shipsPrefix)) ? "internal" : "ships";
|
|
4496
4533
|
}
|
|
@@ -4499,7 +4536,7 @@ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPr
|
|
|
4499
4536
|
}
|
|
4500
4537
|
if (isClaudeMdFile(path))
|
|
4501
4538
|
return "internal";
|
|
4502
|
-
if (isSpecFile2(path))
|
|
4539
|
+
if (isSpecFile2(path, specPaths))
|
|
4503
4540
|
return "spec";
|
|
4504
4541
|
if (isProductScopeFile(path))
|
|
4505
4542
|
return "product";
|
|
@@ -4528,13 +4565,14 @@ function lineAt(content, index) {
|
|
|
4528
4565
|
}
|
|
4529
4566
|
var FORGE_NUMBER_PATTERN = /#[0-9]{2,4}/g;
|
|
4530
4567
|
var TRANCHE_SLUG_VN_PATTERN = /[a-z][a-z-]+-v[0-9]/g;
|
|
4568
|
+
var TASK_NUMBER_PATTERN = /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi;
|
|
4531
4569
|
function legacySlugPattern(legacySlugs) {
|
|
4532
4570
|
if (legacySlugs.length === 0)
|
|
4533
4571
|
return null;
|
|
4534
4572
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
4535
4573
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
4536
4574
|
}
|
|
4537
|
-
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
|
|
4575
|
+
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
4538
4576
|
const findings = [];
|
|
4539
4577
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
4540
4578
|
const grandfathered = new Set(specGrandfather);
|
|
@@ -4546,8 +4584,12 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
4546
4584
|
const productPatterns = [
|
|
4547
4585
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug in product code" }
|
|
4548
4586
|
];
|
|
4587
|
+
const specPatterns = [
|
|
4588
|
+
...patterns,
|
|
4589
|
+
{ pattern: TASK_NUMBER_PATTERN, what: "a task number", group: 2 }
|
|
4590
|
+
];
|
|
4549
4591
|
for (const file of files) {
|
|
4550
|
-
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
|
|
4592
|
+
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, specPaths);
|
|
4551
4593
|
if (!cls || cls === "internal")
|
|
4552
4594
|
continue;
|
|
4553
4595
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
@@ -4556,15 +4598,16 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
4556
4598
|
continue;
|
|
4557
4599
|
const blocking = cls === "product" || cls === "spec";
|
|
4558
4600
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
4559
|
-
const patternsToRun = cls === "product" ? productPatterns : patterns;
|
|
4601
|
+
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
4560
4602
|
for (const { pattern, what, group } of patternsToRun) {
|
|
4561
4603
|
pattern.lastIndex = 0;
|
|
4562
4604
|
let match = pattern.exec(scrubbed);
|
|
4563
4605
|
while (match !== null) {
|
|
4564
4606
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
4607
|
+
const citedIndex = match.index + match[0].indexOf(cited);
|
|
4565
4608
|
findings.push({
|
|
4566
4609
|
file: file.path,
|
|
4567
|
-
line: lineAt(scrubbed,
|
|
4610
|
+
line: lineAt(scrubbed, citedIndex),
|
|
4568
4611
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
4569
4612
|
blocking
|
|
4570
4613
|
});
|
|
@@ -4750,9 +4793,9 @@ function checkSourceComments(files, allowlist = []) {
|
|
|
4750
4793
|
}
|
|
4751
4794
|
return findings;
|
|
4752
4795
|
}
|
|
4753
|
-
function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
|
|
4796
|
+
function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
4754
4797
|
return [
|
|
4755
|
-
...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather),
|
|
4798
|
+
...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather, specPaths),
|
|
4756
4799
|
...checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix)
|
|
4757
4800
|
];
|
|
4758
4801
|
}
|
|
@@ -5217,7 +5260,8 @@ var TaskStatusItemSchema = z.object({
|
|
|
5217
5260
|
}).merge(ObservedSchema);
|
|
5218
5261
|
var TaskStatusResultSchema = z.object({
|
|
5219
5262
|
items: z.array(TaskStatusItemSchema),
|
|
5220
|
-
nextCursor: z.string().nullable()
|
|
5263
|
+
nextCursor: z.string().nullable(),
|
|
5264
|
+
table: z.string()
|
|
5221
5265
|
});
|
|
5222
5266
|
var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
|
|
5223
5267
|
var EscalationInputsSchema = z.object({
|
|
@@ -5561,6 +5605,14 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5561
5605
|
}
|
|
5562
5606
|
return findings;
|
|
5563
5607
|
}
|
|
5608
|
+
// ../../packages/aeg-core/src/gate-cutovers.ts
|
|
5609
|
+
var NO_GATE_CUTOVERS = {
|
|
5610
|
+
objectivesSinceIssue: null,
|
|
5611
|
+
briefSectionsSinceIssue: null,
|
|
5612
|
+
documentationSinceIssue: null,
|
|
5613
|
+
briefRulesSincePr: null,
|
|
5614
|
+
agentBoxesRefusedSincePr: null
|
|
5615
|
+
};
|
|
5564
5616
|
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5565
5617
|
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5566
5618
|
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
@@ -6010,6 +6062,8 @@ function attemptFromEnv(value) {
|
|
|
6010
6062
|
function provenanceFor(input) {
|
|
6011
6063
|
if (input.provenance)
|
|
6012
6064
|
return input.provenance;
|
|
6065
|
+
if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
|
|
6066
|
+
return "unavailable";
|
|
6013
6067
|
if (input.env.role || input.env.task)
|
|
6014
6068
|
return "env_correlated";
|
|
6015
6069
|
return "unavailable";
|
|
@@ -6030,7 +6084,7 @@ function buildHeader(input) {
|
|
|
6030
6084
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6031
6085
|
const round = roundFromEnv(input.env.round);
|
|
6032
6086
|
const subject = {
|
|
6033
|
-
issue: issueFromTask(input.env.task),
|
|
6087
|
+
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6034
6088
|
role,
|
|
6035
6089
|
...round !== undefined ? { round } : {},
|
|
6036
6090
|
...input.subject ?? {}
|
|
@@ -6336,9 +6390,9 @@ function readIssueCheckEnv(env = process.env) {
|
|
|
6336
6390
|
}
|
|
6337
6391
|
|
|
6338
6392
|
// src/lib/brief-assembly.ts
|
|
6339
|
-
import { execFileSync as
|
|
6340
|
-
import { existsSync as
|
|
6341
|
-
import { join as
|
|
6393
|
+
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
6394
|
+
import { existsSync as existsSync4, readFileSync as readFileSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
6395
|
+
import { join as join4 } from "node:path";
|
|
6342
6396
|
|
|
6343
6397
|
// ../../packages/sources/src/commands.ts
|
|
6344
6398
|
var COMMANDS = [
|
|
@@ -6844,6 +6898,10 @@ var COMMANDS = [
|
|
|
6844
6898
|
flag: "--role <name>",
|
|
6845
6899
|
description: "Resolve to a specific role file (roles/<name>.md) instead of the front door"
|
|
6846
6900
|
},
|
|
6901
|
+
{
|
|
6902
|
+
flag: "--template <name>",
|
|
6903
|
+
description: "Print a template the package ships (templates/<name>-template.md) instead of the front door"
|
|
6904
|
+
},
|
|
6847
6905
|
{
|
|
6848
6906
|
flag: "--print",
|
|
6849
6907
|
description: "Emit the resolved file's body (frontmatter stripped) instead of its path — the one-hop mode every generated skill and slash command invokes. A role file whose frontmatter carries an `ack-token` emits that token as the output's own first line."
|
|
@@ -7028,6 +7086,17 @@ var COMMANDS = [
|
|
|
7028
7086
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7029
7087
|
],
|
|
7030
7088
|
status: "shipped"
|
|
7089
|
+
},
|
|
7090
|
+
{
|
|
7091
|
+
name: "log send",
|
|
7092
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7093
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7094
|
+
details: [
|
|
7095
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7096
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7097
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7098
|
+
],
|
|
7099
|
+
status: "shipped"
|
|
7031
7100
|
}
|
|
7032
7101
|
];
|
|
7033
7102
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -7322,7 +7391,12 @@ var VinayaConfigSchema = z5.object({
|
|
|
7322
7391
|
allowlist: z5.array(z5.string().min(1)).optional(),
|
|
7323
7392
|
severity: z5.enum(["warning", "error"]).optional()
|
|
7324
7393
|
}).optional(),
|
|
7325
|
-
specGrandfather: z5.array(z5.string().min(1)).optional()
|
|
7394
|
+
specGrandfather: z5.array(z5.string().min(1)).optional(),
|
|
7395
|
+
specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
7396
|
+
message: "must be a repository-relative path, not an absolute one"
|
|
7397
|
+
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
7398
|
+
message: "must stay inside the repository — no `..` segment"
|
|
7399
|
+
})).optional()
|
|
7326
7400
|
}).optional(),
|
|
7327
7401
|
projects: z5.array(ProjectEntrySchema).optional(),
|
|
7328
7402
|
dispatch: z5.object({
|
|
@@ -7336,6 +7410,13 @@ var VinayaConfigSchema = z5.object({
|
|
|
7336
7410
|
securityThreshold: z5.string().min(1).optional(),
|
|
7337
7411
|
maxRounds: z5.number().optional()
|
|
7338
7412
|
}).optional(),
|
|
7413
|
+
gateCutovers: z5.object({
|
|
7414
|
+
objectivesSinceIssue: z5.number().int().nonnegative().optional(),
|
|
7415
|
+
briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
|
|
7416
|
+
documentationSinceIssue: z5.number().int().nonnegative().optional(),
|
|
7417
|
+
briefRulesSincePr: z5.number().int().nonnegative().optional(),
|
|
7418
|
+
agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
|
|
7419
|
+
}).optional(),
|
|
7339
7420
|
prePush: z5.object({
|
|
7340
7421
|
alwaysRun: z5.array(z5.string()).optional()
|
|
7341
7422
|
}).optional(),
|
|
@@ -7473,6 +7554,18 @@ function resolveReviewPolicy(config) {
|
|
|
7473
7554
|
maxRounds
|
|
7474
7555
|
};
|
|
7475
7556
|
}
|
|
7557
|
+
function resolveGateCutovers(config) {
|
|
7558
|
+
const raw = config?.gateCutovers;
|
|
7559
|
+
if (!raw)
|
|
7560
|
+
return NO_GATE_CUTOVERS;
|
|
7561
|
+
return {
|
|
7562
|
+
objectivesSinceIssue: raw.objectivesSinceIssue ?? null,
|
|
7563
|
+
briefSectionsSinceIssue: raw.briefSectionsSinceIssue ?? null,
|
|
7564
|
+
documentationSinceIssue: raw.documentationSinceIssue ?? null,
|
|
7565
|
+
briefRulesSincePr: raw.briefRulesSincePr ?? null,
|
|
7566
|
+
agentBoxesRefusedSincePr: raw.agentBoxesRefusedSincePr ?? null
|
|
7567
|
+
};
|
|
7568
|
+
}
|
|
7476
7569
|
function resolveRuntimeDirSetting(config) {
|
|
7477
7570
|
return config?.runtimeDir ?? null;
|
|
7478
7571
|
}
|
|
@@ -7528,7 +7621,8 @@ async function trustAnchorRepoAsync() {
|
|
|
7528
7621
|
try {
|
|
7529
7622
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
7530
7623
|
encoding: "utf-8",
|
|
7531
|
-
timeout: 1e4
|
|
7624
|
+
timeout: 1e4,
|
|
7625
|
+
killSignal: "SIGKILL"
|
|
7532
7626
|
});
|
|
7533
7627
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
7534
7628
|
} catch {
|
|
@@ -7589,7 +7683,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
7589
7683
|
const repo = await trustAnchorRepoAsync();
|
|
7590
7684
|
if (!repo)
|
|
7591
7685
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7592
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
7686
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
7593
7687
|
return stdout;
|
|
7594
7688
|
}
|
|
7595
7689
|
function firstLine(err) {
|
|
@@ -7679,13 +7773,47 @@ function packageRoot(moduleUrl) {
|
|
|
7679
7773
|
return dir;
|
|
7680
7774
|
}
|
|
7681
7775
|
|
|
7776
|
+
// src/commands/doctrine.ts
|
|
7777
|
+
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
7778
|
+
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
7779
|
+
import { dirname as dirname3, join as join3, sep } from "node:path";
|
|
7780
|
+
import matter2 from "gray-matter";
|
|
7781
|
+
var ENTRY_SEGMENTS = ["skills", "aeg", "SKILL.md"];
|
|
7782
|
+
function resolveDoctrineRoot(pkg = packageRoot(import.meta.url), cwd = process.cwd()) {
|
|
7783
|
+
return resolveDoctrineRootInfo(pkg, cwd)?.root ?? null;
|
|
7784
|
+
}
|
|
7785
|
+
function gitToplevel(cwd) {
|
|
7786
|
+
try {
|
|
7787
|
+
return execFileSync4("git", ["-C", cwd, "rev-parse", "--show-toplevel"], {
|
|
7788
|
+
encoding: "utf8",
|
|
7789
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
7790
|
+
}).trim();
|
|
7791
|
+
} catch {
|
|
7792
|
+
return null;
|
|
7793
|
+
}
|
|
7794
|
+
}
|
|
7795
|
+
function resolveDoctrineRootInfo(pkg = packageRoot(import.meta.url), cwd = process.cwd()) {
|
|
7796
|
+
const toplevel = gitToplevel(cwd);
|
|
7797
|
+
if (toplevel !== null) {
|
|
7798
|
+
const treeRoot = join3(toplevel, "aeg-root");
|
|
7799
|
+
if (existsSync3(join3(treeRoot, "roles")))
|
|
7800
|
+
return { root: treeRoot, source: "tree" };
|
|
7801
|
+
}
|
|
7802
|
+
const fromSource = !pkg.split(sep).includes("node_modules");
|
|
7803
|
+
const bundleRoot = fromSource ? join3(dirname3(dirname3(pkg)), "aeg-root") : join3(pkg, "aeg-root");
|
|
7804
|
+
return hasDoctrineEntry(bundleRoot) ? { root: bundleRoot, source: "bundle" } : null;
|
|
7805
|
+
}
|
|
7806
|
+
function hasDoctrineEntry(root) {
|
|
7807
|
+
return existsSync3(join3(root, ...ENTRY_SEGMENTS));
|
|
7808
|
+
}
|
|
7809
|
+
|
|
7682
7810
|
// src/lib/brief-assembly.ts
|
|
7683
7811
|
var PACKAGE_ROOT = packageRoot(import.meta.url);
|
|
7684
|
-
var PACKAGED_TEMPLATE_PATH =
|
|
7685
|
-
var TEMPLATE_PATH =
|
|
7812
|
+
var PACKAGED_TEMPLATE_PATH = join4(PACKAGE_ROOT, "aeg-root", "templates", "brief-template.md");
|
|
7813
|
+
var TEMPLATE_PATH = existsSync4(PACKAGED_TEMPLATE_PATH) ? PACKAGED_TEMPLATE_PATH : join4(PACKAGE_ROOT, "..", "..", "aeg-root", "templates", "brief-template.md");
|
|
7686
7814
|
function git(args) {
|
|
7687
7815
|
try {
|
|
7688
|
-
return
|
|
7816
|
+
return execFileSync5("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
7689
7817
|
} catch {
|
|
7690
7818
|
return "";
|
|
7691
7819
|
}
|