@attalabs/vinaya 0.37.0 → 0.38.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/aeg-root/enforcement.md +5 -4
- package/aeg-root/roles/developer/reference.md +24 -22
- package/aeg-root/roles/developer.md +4 -4
- package/aeg-root/roles/planner/reference.md +11 -0
- package/aeg-root/roles/reviewer.md +5 -3
- package/aeg-root/roles/security.md +3 -2
- package/aeg-root/state-machine.md +1 -1
- package/aeg-root/templates/brief-template.md +4 -4
- package/aeg-root/tranche-model.md +6 -0
- package/dist/checks/bin/check-body-bare-digits.js +139 -12
- package/dist/checks/bin/check-branch-topology.js +171 -13
- package/dist/checks/bin/check-brief-shape.js +139 -12
- package/dist/checks/bin/check-changeset-coverage.js +177 -17
- package/dist/checks/bin/check-closes-n.js +171 -13
- package/dist/checks/bin/check-coherence.js +171 -13
- package/dist/checks/bin/check-dead-branch-push.js +139 -12
- package/dist/checks/bin/check-dispatch-readiness.js +195 -23
- package/dist/checks/bin/check-doc-coverage-push.js +173 -13
- package/dist/checks/bin/check-doc-coverage.js +180 -13
- package/dist/checks/bin/check-doctrine-no-procedures.js +139 -12
- package/dist/checks/bin/check-doctrine-portability.js +173 -13
- package/dist/checks/bin/check-evidence-fresh.js +173 -13
- package/dist/checks/bin/check-exec-bits.js +173 -13
- package/dist/checks/bin/check-first-push-dispatch.js +171 -13
- package/dist/checks/bin/check-issue-assignment.js +171 -13
- package/dist/checks/bin/check-issue-milestone-attach.js +139 -12
- package/dist/checks/bin/check-issue-objectives-numbering.js +139 -12
- package/dist/checks/bin/check-issue-parts-coverage.js +139 -12
- package/dist/checks/bin/check-issue-surface-globs.js +171 -13
- package/dist/checks/bin/check-issue-title-grammar.js +139 -12
- package/dist/checks/bin/check-issue-tranche-label.js +139 -12
- package/dist/checks/bin/check-main-branch-refusal.js +139 -12
- package/dist/checks/bin/check-no-disk-state.js +139 -12
- package/dist/checks/bin/check-pr-premise-reassert.js +139 -12
- package/dist/checks/bin/check-pr-report-density.js +139 -12
- package/dist/checks/bin/check-principal-test-plan-wait.js +139 -12
- package/dist/checks/bin/check-quoted-command.js +173 -13
- package/dist/checks/bin/check-reader-resolvable-prose.js +173 -13
- package/dist/checks/bin/check-registry-gates.js +406 -68
- package/dist/checks/bin/check-retired-vocabulary.js +173 -13
- package/dist/checks/bin/check-review-gate.js +139 -12
- package/dist/checks/bin/check-single-plan-pr.js +139 -12
- package/dist/checks/bin/check-surface-scope.js +171 -13
- package/dist/checks/bin/check-test-plan.js +139 -12
- package/dist/checks/bin/check-token-collection-wired.js +139 -12
- package/dist/checks/bin/check-workspace-escape.js +173 -13
- package/dist/checks/bin/verify-dispatch.js +3849 -0
- package/dist/index.js +7348 -2095
- package/dist/lib/pre-push-cache-test-run.js +42 -2
- package/dist/lib/pre-push-changed-files.js +16 -11
- package/dist/lib/pre-push-select-tests.js +177 -21
- package/package.json +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +33 -15
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +31 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +214 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +11 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +5 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -145
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +63 -14
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +56 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +7 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +219 -15
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +38 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
- 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/page_client-reference-manifest.js +1 -1
- 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/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/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]__04adkz-._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__14ui9sz._.js → [root-of-the-server]__0jdjsxe._.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]__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/_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/1-acpmtfmrc35.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3qtt1v3ya-ofe.js → 2f2y8xxok8zph.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3l56x8wjdzvaw.js → 2xevgia1h8g0y.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/dist/checks/bin/check-token-report.js +0 -6526
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vtfb0g813gki.js +0 -1
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
|
@@ -627,6 +627,33 @@ function tasksFromIssues(issues) {
|
|
|
627
627
|
}
|
|
628
628
|
return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
|
|
629
629
|
}
|
|
630
|
+
function resolveDuplicateTasks(tasks, isOpen) {
|
|
631
|
+
const byId = new Map;
|
|
632
|
+
for (const t of tasks)
|
|
633
|
+
byId.set(t.id, [...byId.get(t.id) ?? [], t]);
|
|
634
|
+
const resolved = [];
|
|
635
|
+
const conflicts = [];
|
|
636
|
+
for (const [id, group] of byId) {
|
|
637
|
+
const first = group[0];
|
|
638
|
+
if (!first)
|
|
639
|
+
continue;
|
|
640
|
+
if (group.length === 1) {
|
|
641
|
+
resolved.push(first);
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
const number = (t) => t.issue ?? 0;
|
|
645
|
+
const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
|
|
646
|
+
if (open.length > 1) {
|
|
647
|
+
conflicts.push({ id, issues: open.map(number) });
|
|
648
|
+
resolved.push(open[0]);
|
|
649
|
+
} else if (open.length === 1) {
|
|
650
|
+
resolved.push(open[0]);
|
|
651
|
+
} else {
|
|
652
|
+
resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
|
|
656
|
+
}
|
|
630
657
|
async function fetchTrancheIssuesAsync(owner, repo, slug) {
|
|
631
658
|
return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
|
|
632
659
|
}
|
|
@@ -1434,7 +1461,7 @@ function mapReviewDecision(decision) {
|
|
|
1434
1461
|
function buildBranchName(tranche, taskId) {
|
|
1435
1462
|
return `task/${tranche}/${taskId}`;
|
|
1436
1463
|
}
|
|
1437
|
-
async function
|
|
1464
|
+
async function fetchForgeFactsByIssue(input) {
|
|
1438
1465
|
const token = await resolveGithubToken(input.token);
|
|
1439
1466
|
if (!token) {
|
|
1440
1467
|
return {
|
|
@@ -1444,7 +1471,13 @@ async function fetchForgeFacts(input) {
|
|
|
1444
1471
|
reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
|
|
1445
1472
|
};
|
|
1446
1473
|
}
|
|
1447
|
-
const
|
|
1474
|
+
const seen = new Set;
|
|
1475
|
+
const queriedTasks = input.tasks.filter((t) => {
|
|
1476
|
+
if (t.issue === null || seen.has(t.issue))
|
|
1477
|
+
return false;
|
|
1478
|
+
seen.add(t.issue);
|
|
1479
|
+
return true;
|
|
1480
|
+
});
|
|
1448
1481
|
if (queriedTasks.length === 0) {
|
|
1449
1482
|
return { facts: new Map, prRefs: new Map, unavailable: false };
|
|
1450
1483
|
}
|
|
@@ -1472,21 +1505,52 @@ async function fetchForgeFacts(input) {
|
|
|
1472
1505
|
};
|
|
1473
1506
|
}
|
|
1474
1507
|
for (const task of queriedTasks) {
|
|
1475
|
-
const
|
|
1476
|
-
const raw = extractRawFromResponse(response.repository, alias);
|
|
1508
|
+
const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
|
|
1477
1509
|
const mapped = mapForgeFacts(raw);
|
|
1478
1510
|
if (mapped)
|
|
1479
|
-
facts.set(task.
|
|
1511
|
+
facts.set(task.issue, mapped);
|
|
1480
1512
|
const pr = raw.pullRequest;
|
|
1481
1513
|
if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
|
|
1482
|
-
prRefs.set(task.
|
|
1514
|
+
prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
|
|
1483
1515
|
}
|
|
1484
1516
|
}
|
|
1485
1517
|
return { facts, prRefs, unavailable: false };
|
|
1486
1518
|
}
|
|
1519
|
+
async function fetchForgeFacts(input) {
|
|
1520
|
+
const byIssue = await fetchForgeFactsByIssue(input);
|
|
1521
|
+
if (byIssue.unavailable) {
|
|
1522
|
+
return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
|
|
1523
|
+
}
|
|
1524
|
+
const facts = new Map;
|
|
1525
|
+
const prRefs = new Map;
|
|
1526
|
+
const winner = new Map;
|
|
1527
|
+
for (const task of input.tasks) {
|
|
1528
|
+
if (task.issue === null)
|
|
1529
|
+
continue;
|
|
1530
|
+
const current = winner.get(task.id);
|
|
1531
|
+
if (current === undefined || outranks(byIssue.facts, task.issue, current))
|
|
1532
|
+
winner.set(task.id, task.issue);
|
|
1533
|
+
}
|
|
1534
|
+
for (const [taskId, issue] of winner) {
|
|
1535
|
+
const f = byIssue.facts.get(issue);
|
|
1536
|
+
if (f)
|
|
1537
|
+
facts.set(taskId, f);
|
|
1538
|
+
const pr = byIssue.prRefs.get(issue);
|
|
1539
|
+
if (pr)
|
|
1540
|
+
prRefs.set(taskId, pr);
|
|
1541
|
+
}
|
|
1542
|
+
return { facts, prRefs, unavailable: false };
|
|
1543
|
+
}
|
|
1544
|
+
function outranks(facts, candidate, current) {
|
|
1545
|
+
const candidateOpen = facts.get(candidate)?.issueState === "open";
|
|
1546
|
+
const currentOpen = facts.get(current)?.issueState === "open";
|
|
1547
|
+
if (candidateOpen !== currentOpen)
|
|
1548
|
+
return candidateOpen;
|
|
1549
|
+
return candidate > current;
|
|
1550
|
+
}
|
|
1487
1551
|
function buildBatchQuery(tranche, tasks) {
|
|
1488
1552
|
const perTask = tasks.map((task) => {
|
|
1489
|
-
const a = aliasFor(task.
|
|
1553
|
+
const a = aliasFor(task.issue);
|
|
1490
1554
|
const branch = buildBranchName(tranche, task.id);
|
|
1491
1555
|
return `
|
|
1492
1556
|
${a}_issue: issue(number: ${task.issue}) {
|
|
@@ -1528,9 +1592,8 @@ function buildBatchQuery(tranche, tasks) {
|
|
|
1528
1592
|
}
|
|
1529
1593
|
}`;
|
|
1530
1594
|
}
|
|
1531
|
-
function aliasFor(
|
|
1532
|
-
|
|
1533
|
-
return `t_${sanitized}`;
|
|
1595
|
+
function aliasFor(issue) {
|
|
1596
|
+
return `i_${issue}`;
|
|
1534
1597
|
}
|
|
1535
1598
|
function extractRawFromResponse(repository, alias) {
|
|
1536
1599
|
const issue = repository[`${alias}_issue`];
|
|
@@ -2361,6 +2424,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
|
|
|
2361
2424
|
function isProseLocation(location) {
|
|
2362
2425
|
if (ROLE_FILE_LOCATION.test(location))
|
|
2363
2426
|
return true;
|
|
2427
|
+
return isBodyOrCommentLocation(location);
|
|
2428
|
+
}
|
|
2429
|
+
function isBodyOrCommentLocation(location) {
|
|
2364
2430
|
if (FILE_SHAPED_LOCATION.test(location))
|
|
2365
2431
|
return false;
|
|
2366
2432
|
return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
|
|
@@ -2387,7 +2453,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
|
|
|
2387
2453
|
const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
|
|
2388
2454
|
if (!wouldBlock)
|
|
2389
2455
|
return { outcome: "non_blocking", deferralReason: null };
|
|
2390
|
-
const hasLocation = location !== undefined && location.length > 0;
|
|
2456
|
+
const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
|
|
2391
2457
|
if (hasLocation && context.inSurface && !context.inSurface(location)) {
|
|
2392
2458
|
return { outcome: "deferred", deferralReason: "outside-surface" };
|
|
2393
2459
|
}
|
|
@@ -4057,6 +4123,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
4057
4123
|
"html",
|
|
4058
4124
|
"css"
|
|
4059
4125
|
]);
|
|
4126
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
4127
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
4060
4128
|
|
|
4061
4129
|
// ../../packages/aeg-core/src/task-branch-identity.ts
|
|
4062
4130
|
var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
|
|
@@ -4934,6 +5002,55 @@ function checkG6(rows, registeredCheckNames) {
|
|
|
4934
5002
|
}
|
|
4935
5003
|
return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4936
5004
|
}
|
|
5005
|
+
function reachesProducer(file, producers, imports) {
|
|
5006
|
+
const seen = new Set([file]);
|
|
5007
|
+
const queue = [file];
|
|
5008
|
+
for (let next = queue.pop();next !== undefined; next = queue.pop()) {
|
|
5009
|
+
if (producers.has(next))
|
|
5010
|
+
return true;
|
|
5011
|
+
for (const dep of imports.get(next) ?? []) {
|
|
5012
|
+
if (!seen.has(dep)) {
|
|
5013
|
+
seen.add(dep);
|
|
5014
|
+
queue.push(dep);
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
5018
|
+
return false;
|
|
5019
|
+
}
|
|
5020
|
+
function checkG7(input) {
|
|
5021
|
+
if (!input.enforcementMapPresent)
|
|
5022
|
+
return { check: "G7", status: "info", findings: [] };
|
|
5023
|
+
const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
|
|
5024
|
+
const findings = [];
|
|
5025
|
+
for (const path of subjects) {
|
|
5026
|
+
if (path in input.exemptions)
|
|
5027
|
+
continue;
|
|
5028
|
+
if (!reachesProducer(path, input.producers, input.imports)) {
|
|
5029
|
+
findings.push({
|
|
5030
|
+
path,
|
|
5031
|
+
reason: `"${path}" ${input.crossingFiles.includes(path) ? "makes a GitHub-writing call" : "implements a blocking gate"} but neither is a log producer nor imports one, and it is not exempted with a reason`
|
|
5032
|
+
});
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
5035
|
+
for (const [path, reason] of Object.entries(input.exemptions)) {
|
|
5036
|
+
if (reason.trim() === "") {
|
|
5037
|
+
findings.push({ path, reason: `exemption for "${path}" states no reason` });
|
|
5038
|
+
} else if (!input.existsFn(path)) {
|
|
5039
|
+
findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
|
|
5040
|
+
} else if (!subjects.has(path)) {
|
|
5041
|
+
findings.push({
|
|
5042
|
+
path,
|
|
5043
|
+
reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
|
|
5044
|
+
});
|
|
5045
|
+
} else if (reachesProducer(path, input.producers, input.imports)) {
|
|
5046
|
+
findings.push({
|
|
5047
|
+
path,
|
|
5048
|
+
reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
|
|
5049
|
+
});
|
|
5050
|
+
}
|
|
5051
|
+
}
|
|
5052
|
+
return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
5053
|
+
}
|
|
4937
5054
|
// ../../packages/aeg-core/src/dead-branch-push-guard.ts
|
|
4938
5055
|
function checkDeadBranchPush(input) {
|
|
4939
5056
|
const { branch, prState, prNumber } = input;
|
|
@@ -5113,6 +5230,11 @@ function checkDispatchReadiness(input) {
|
|
|
5113
5230
|
push("depends-on-unresolvable", `dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
|
|
5114
5231
|
continue;
|
|
5115
5232
|
}
|
|
5233
|
+
if (dep.readFailed === true) {
|
|
5234
|
+
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5235
|
+
push("depends-on-read-failed", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, but the forge could not be read for that dependency — not a claim about its merge status. Retry the check.`);
|
|
5236
|
+
continue;
|
|
5237
|
+
}
|
|
5116
5238
|
if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
|
|
5117
5239
|
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5118
5240
|
push("depends-on-not-merged", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
|
|
@@ -5695,6 +5817,7 @@ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
|
5695
5817
|
|
|
5696
5818
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5697
5819
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5820
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
5698
5821
|
var ROLE_VALUES = [
|
|
5699
5822
|
"planner",
|
|
5700
5823
|
"developer",
|
|
@@ -5788,6 +5911,9 @@ var envelopeTail = {
|
|
|
5788
5911
|
var ReviewFindingSchema = z3.object({
|
|
5789
5912
|
id: z3.string(),
|
|
5790
5913
|
severity: z3.string(),
|
|
5914
|
+
location: z3.string().optional(),
|
|
5915
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
5916
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
5791
5917
|
state: z3.string().optional(),
|
|
5792
5918
|
severity_scale: z3.string().optional(),
|
|
5793
5919
|
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
@@ -5843,7 +5969,8 @@ var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
|
5843
5969
|
z3.object({
|
|
5844
5970
|
...dispatchShared,
|
|
5845
5971
|
event: z3.literal("dispatch_failed"),
|
|
5846
|
-
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
5972
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
5973
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
5847
5974
|
usage: dispatchUsageField
|
|
5848
5975
|
}).strict()
|
|
5849
5976
|
]);
|
|
@@ -6627,6 +6754,8 @@ var REGISTRY = [
|
|
|
6627
6754
|
timeoutMs: 15000,
|
|
6628
6755
|
env: {
|
|
6629
6756
|
BASE_SHA: { optional: true },
|
|
6757
|
+
GIT_INDEX_FILE: { optional: true },
|
|
6758
|
+
VINAYA_COMMIT_HOOK: { optional: true },
|
|
6630
6759
|
PR_BODY: { optional: true },
|
|
6631
6760
|
PR_BODY_FILE: { optional: true },
|
|
6632
6761
|
PR_NUMBER: { optional: true },
|
|
@@ -9158,6 +9287,10 @@ var COMMANDS = [
|
|
|
9158
9287
|
{
|
|
9159
9288
|
flag: "--agent <claude|codex|gemini>",
|
|
9160
9289
|
description: "Vendor for the developer and both reviewers this run dispatches"
|
|
9290
|
+
},
|
|
9291
|
+
{
|
|
9292
|
+
flag: "--quiet",
|
|
9293
|
+
description: "Hide the detail lines (an agent's prose, full commands, failed-result tails) on the live terminal; the driver log file keeps them"
|
|
9161
9294
|
}
|
|
9162
9295
|
],
|
|
9163
9296
|
details: [
|
|
@@ -9171,7 +9304,14 @@ var COMMANDS = [
|
|
|
9171
9304
|
{
|
|
9172
9305
|
name: "task status",
|
|
9173
9306
|
description: "Every open task with a frozen brief, its pull request, and whether its loop is running, paused, or published",
|
|
9174
|
-
flags: [
|
|
9307
|
+
flags: [
|
|
9308
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" },
|
|
9309
|
+
{
|
|
9310
|
+
flag: "--follow",
|
|
9311
|
+
description: "Tail the task's driver log live, with its detail lines, on either the `<tranche> <n>` form or `--issue <n>`"
|
|
9312
|
+
},
|
|
9313
|
+
{ flag: "--quiet", description: "With `--follow`, hide the detail lines; the log file is unchanged" }
|
|
9314
|
+
],
|
|
9175
9315
|
details: [
|
|
9176
9316
|
"Read-only: one `gh issue list` for every open task Issue across every tranche (title/label resolved through the same `resolveTaskIssueRef` `list-tasks.ts` already uses), the open pull request per branch, and the driver pid record / pause record / publish effect markers under `<outboxRoot>/dev-review-loop/<task>/` — never a `ps` scan, never a re-parse of posted verdict comments to decide `published`.",
|
|
9177
9317
|
"`running` names the driver's pid (`review-validity-v1` task 7's pid record); `paused` names the reason from the pause record; `published` means the newest round's reviewer and security verdict effect markers both read `posted`; `no driver` is the fallback when none of the above holds.",
|
|
@@ -9207,6 +9347,26 @@ var COMMANDS = [
|
|
|
9207
9347
|
],
|
|
9208
9348
|
status: "shipped"
|
|
9209
9349
|
},
|
|
9350
|
+
{
|
|
9351
|
+
name: "task-tools result-proof",
|
|
9352
|
+
description: "Prove, live on this host, that a CLI delivers the Developer's turn result as its own structured final output",
|
|
9353
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
9354
|
+
details: [
|
|
9355
|
+
"Runs real Developer-shaped dispatches on this host — the driver-run dev-tools registered and called, the agent's own sandbox where the host supports it, the subscription login, and the dispatch's own argv — and asks for the versioned `DeveloperTurnResult` (`completed`, `blocked` or `needs_ruling`) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`, with the dispatch's Stop hook plus one that rejects the first stop; Codex `--output-schema` under `exec --json` and `exec resume --json`.",
|
|
9356
|
+
"Cases: a first and a resumed session (the same provider session, a fresh result, exactly one accepted); a schema-valid but semantically invalid result (an unknown finding id, a ruling request naming no permissible decision), which the driver rejects; malformed output, which never reaches the driver; and a cancelled run, a provider error and context exhaustion, each ending with no accepted result. Each case prints whether a schema-valid result reached the driver, the result, and the event it was read from; exits 1 when any case fails. Never publishes, opens a pull request or writes the forge."
|
|
9357
|
+
],
|
|
9358
|
+
status: "shipped"
|
|
9359
|
+
},
|
|
9360
|
+
{
|
|
9361
|
+
name: "task-tools review-result-proof",
|
|
9362
|
+
description: "Prove, live on this host, that a CLI delivers a reviewer's result as its own structured final output, concurrent and fresh",
|
|
9363
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
9364
|
+
details: [
|
|
9365
|
+
"Runs real reviewer-shaped dispatches on this host — fresh, non-resumed sessions, the agent's own sandbox where the host supports it, the subscription login, read-only grants, and the staged diff and review-input manifest — and asks for the versioned `ReviewResult` (`completed` or `blocked`, bound to the controller's role, head and manifest digest) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`; Codex `--output-schema` under `exec --json`. Both the code-reviewer and the security-reviewer role run, concurrently against one manifest, each accepted result attributed to its own role.",
|
|
9366
|
+
"Cases: a role mismatch, a wrong head and a wrong manifest digest; an objective id outside the brief, a severity outside the role's scale and a finding without a file (all refused) and a finding without a line (accepted); and a blocked, malformed, missing, cancelled, provider-error and context-exhausted outcome, each recorded as no review, never approval. Each case prints whether a schema-valid result reached the driver and what the controller made of it; exits 1 when any case fails. Never writes the forge and leaves the loop's reviewer dispatch and result files untouched."
|
|
9367
|
+
],
|
|
9368
|
+
status: "shipped"
|
|
9369
|
+
},
|
|
9210
9370
|
{
|
|
9211
9371
|
name: "pr create",
|
|
9212
9372
|
description: "Open a pull request after full brief-schema validation",
|
|
@@ -639,6 +639,33 @@ function tasksFromIssues(issues) {
|
|
|
639
639
|
}
|
|
640
640
|
return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
|
|
641
641
|
}
|
|
642
|
+
function resolveDuplicateTasks(tasks, isOpen) {
|
|
643
|
+
const byId = new Map;
|
|
644
|
+
for (const t of tasks)
|
|
645
|
+
byId.set(t.id, [...byId.get(t.id) ?? [], t]);
|
|
646
|
+
const resolved = [];
|
|
647
|
+
const conflicts = [];
|
|
648
|
+
for (const [id, group] of byId) {
|
|
649
|
+
const first = group[0];
|
|
650
|
+
if (!first)
|
|
651
|
+
continue;
|
|
652
|
+
if (group.length === 1) {
|
|
653
|
+
resolved.push(first);
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
const number = (t) => t.issue ?? 0;
|
|
657
|
+
const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
|
|
658
|
+
if (open.length > 1) {
|
|
659
|
+
conflicts.push({ id, issues: open.map(number) });
|
|
660
|
+
resolved.push(open[0]);
|
|
661
|
+
} else if (open.length === 1) {
|
|
662
|
+
resolved.push(open[0]);
|
|
663
|
+
} else {
|
|
664
|
+
resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
|
|
668
|
+
}
|
|
642
669
|
async function fetchTrancheIssuesAsync(owner, repo, slug) {
|
|
643
670
|
return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
|
|
644
671
|
}
|
|
@@ -1446,7 +1473,7 @@ function mapReviewDecision(decision) {
|
|
|
1446
1473
|
function buildBranchName(tranche, taskId) {
|
|
1447
1474
|
return `task/${tranche}/${taskId}`;
|
|
1448
1475
|
}
|
|
1449
|
-
async function
|
|
1476
|
+
async function fetchForgeFactsByIssue(input) {
|
|
1450
1477
|
const token = await resolveGithubToken(input.token);
|
|
1451
1478
|
if (!token) {
|
|
1452
1479
|
return {
|
|
@@ -1456,7 +1483,13 @@ async function fetchForgeFacts(input) {
|
|
|
1456
1483
|
reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
|
|
1457
1484
|
};
|
|
1458
1485
|
}
|
|
1459
|
-
const
|
|
1486
|
+
const seen = new Set;
|
|
1487
|
+
const queriedTasks = input.tasks.filter((t) => {
|
|
1488
|
+
if (t.issue === null || seen.has(t.issue))
|
|
1489
|
+
return false;
|
|
1490
|
+
seen.add(t.issue);
|
|
1491
|
+
return true;
|
|
1492
|
+
});
|
|
1460
1493
|
if (queriedTasks.length === 0) {
|
|
1461
1494
|
return { facts: new Map, prRefs: new Map, unavailable: false };
|
|
1462
1495
|
}
|
|
@@ -1484,21 +1517,52 @@ async function fetchForgeFacts(input) {
|
|
|
1484
1517
|
};
|
|
1485
1518
|
}
|
|
1486
1519
|
for (const task of queriedTasks) {
|
|
1487
|
-
const
|
|
1488
|
-
const raw = extractRawFromResponse(response.repository, alias);
|
|
1520
|
+
const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
|
|
1489
1521
|
const mapped = mapForgeFacts(raw);
|
|
1490
1522
|
if (mapped)
|
|
1491
|
-
facts.set(task.
|
|
1523
|
+
facts.set(task.issue, mapped);
|
|
1492
1524
|
const pr = raw.pullRequest;
|
|
1493
1525
|
if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
|
|
1494
|
-
prRefs.set(task.
|
|
1526
|
+
prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
|
|
1495
1527
|
}
|
|
1496
1528
|
}
|
|
1497
1529
|
return { facts, prRefs, unavailable: false };
|
|
1498
1530
|
}
|
|
1531
|
+
async function fetchForgeFacts(input) {
|
|
1532
|
+
const byIssue = await fetchForgeFactsByIssue(input);
|
|
1533
|
+
if (byIssue.unavailable) {
|
|
1534
|
+
return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
|
|
1535
|
+
}
|
|
1536
|
+
const facts = new Map;
|
|
1537
|
+
const prRefs = new Map;
|
|
1538
|
+
const winner = new Map;
|
|
1539
|
+
for (const task of input.tasks) {
|
|
1540
|
+
if (task.issue === null)
|
|
1541
|
+
continue;
|
|
1542
|
+
const current = winner.get(task.id);
|
|
1543
|
+
if (current === undefined || outranks(byIssue.facts, task.issue, current))
|
|
1544
|
+
winner.set(task.id, task.issue);
|
|
1545
|
+
}
|
|
1546
|
+
for (const [taskId, issue] of winner) {
|
|
1547
|
+
const f = byIssue.facts.get(issue);
|
|
1548
|
+
if (f)
|
|
1549
|
+
facts.set(taskId, f);
|
|
1550
|
+
const pr = byIssue.prRefs.get(issue);
|
|
1551
|
+
if (pr)
|
|
1552
|
+
prRefs.set(taskId, pr);
|
|
1553
|
+
}
|
|
1554
|
+
return { facts, prRefs, unavailable: false };
|
|
1555
|
+
}
|
|
1556
|
+
function outranks(facts, candidate, current) {
|
|
1557
|
+
const candidateOpen = facts.get(candidate)?.issueState === "open";
|
|
1558
|
+
const currentOpen = facts.get(current)?.issueState === "open";
|
|
1559
|
+
if (candidateOpen !== currentOpen)
|
|
1560
|
+
return candidateOpen;
|
|
1561
|
+
return candidate > current;
|
|
1562
|
+
}
|
|
1499
1563
|
function buildBatchQuery(tranche, tasks) {
|
|
1500
1564
|
const perTask = tasks.map((task) => {
|
|
1501
|
-
const a = aliasFor(task.
|
|
1565
|
+
const a = aliasFor(task.issue);
|
|
1502
1566
|
const branch = buildBranchName(tranche, task.id);
|
|
1503
1567
|
return `
|
|
1504
1568
|
${a}_issue: issue(number: ${task.issue}) {
|
|
@@ -1540,9 +1604,8 @@ function buildBatchQuery(tranche, tasks) {
|
|
|
1540
1604
|
}
|
|
1541
1605
|
}`;
|
|
1542
1606
|
}
|
|
1543
|
-
function aliasFor(
|
|
1544
|
-
|
|
1545
|
-
return `t_${sanitized}`;
|
|
1607
|
+
function aliasFor(issue) {
|
|
1608
|
+
return `i_${issue}`;
|
|
1546
1609
|
}
|
|
1547
1610
|
function extractRawFromResponse(repository, alias) {
|
|
1548
1611
|
const issue = repository[`${alias}_issue`];
|
|
@@ -2373,6 +2436,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
|
|
|
2373
2436
|
function isProseLocation(location) {
|
|
2374
2437
|
if (ROLE_FILE_LOCATION.test(location))
|
|
2375
2438
|
return true;
|
|
2439
|
+
return isBodyOrCommentLocation(location);
|
|
2440
|
+
}
|
|
2441
|
+
function isBodyOrCommentLocation(location) {
|
|
2376
2442
|
if (FILE_SHAPED_LOCATION.test(location))
|
|
2377
2443
|
return false;
|
|
2378
2444
|
return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
|
|
@@ -2399,7 +2465,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
|
|
|
2399
2465
|
const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
|
|
2400
2466
|
if (!wouldBlock)
|
|
2401
2467
|
return { outcome: "non_blocking", deferralReason: null };
|
|
2402
|
-
const hasLocation = location !== undefined && location.length > 0;
|
|
2468
|
+
const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
|
|
2403
2469
|
if (hasLocation && context.inSurface && !context.inSurface(location)) {
|
|
2404
2470
|
return { outcome: "deferred", deferralReason: "outside-surface" };
|
|
2405
2471
|
}
|
|
@@ -4069,6 +4135,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
4069
4135
|
"html",
|
|
4070
4136
|
"css"
|
|
4071
4137
|
]);
|
|
4138
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
4139
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
4072
4140
|
|
|
4073
4141
|
// ../../packages/aeg-core/src/task-branch-identity.ts
|
|
4074
4142
|
var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
|
|
@@ -4946,6 +5014,55 @@ function checkG6(rows, registeredCheckNames) {
|
|
|
4946
5014
|
}
|
|
4947
5015
|
return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4948
5016
|
}
|
|
5017
|
+
function reachesProducer(file, producers, imports) {
|
|
5018
|
+
const seen = new Set([file]);
|
|
5019
|
+
const queue = [file];
|
|
5020
|
+
for (let next = queue.pop();next !== undefined; next = queue.pop()) {
|
|
5021
|
+
if (producers.has(next))
|
|
5022
|
+
return true;
|
|
5023
|
+
for (const dep of imports.get(next) ?? []) {
|
|
5024
|
+
if (!seen.has(dep)) {
|
|
5025
|
+
seen.add(dep);
|
|
5026
|
+
queue.push(dep);
|
|
5027
|
+
}
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
5030
|
+
return false;
|
|
5031
|
+
}
|
|
5032
|
+
function checkG7(input) {
|
|
5033
|
+
if (!input.enforcementMapPresent)
|
|
5034
|
+
return { check: "G7", status: "info", findings: [] };
|
|
5035
|
+
const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
|
|
5036
|
+
const findings = [];
|
|
5037
|
+
for (const path of subjects) {
|
|
5038
|
+
if (path in input.exemptions)
|
|
5039
|
+
continue;
|
|
5040
|
+
if (!reachesProducer(path, input.producers, input.imports)) {
|
|
5041
|
+
findings.push({
|
|
5042
|
+
path,
|
|
5043
|
+
reason: `"${path}" ${input.crossingFiles.includes(path) ? "makes a GitHub-writing call" : "implements a blocking gate"} but neither is a log producer nor imports one, and it is not exempted with a reason`
|
|
5044
|
+
});
|
|
5045
|
+
}
|
|
5046
|
+
}
|
|
5047
|
+
for (const [path, reason] of Object.entries(input.exemptions)) {
|
|
5048
|
+
if (reason.trim() === "") {
|
|
5049
|
+
findings.push({ path, reason: `exemption for "${path}" states no reason` });
|
|
5050
|
+
} else if (!input.existsFn(path)) {
|
|
5051
|
+
findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
|
|
5052
|
+
} else if (!subjects.has(path)) {
|
|
5053
|
+
findings.push({
|
|
5054
|
+
path,
|
|
5055
|
+
reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
|
|
5056
|
+
});
|
|
5057
|
+
} else if (reachesProducer(path, input.producers, input.imports)) {
|
|
5058
|
+
findings.push({
|
|
5059
|
+
path,
|
|
5060
|
+
reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
|
|
5061
|
+
});
|
|
5062
|
+
}
|
|
5063
|
+
}
|
|
5064
|
+
return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
5065
|
+
}
|
|
4949
5066
|
// ../../packages/aeg-core/src/dead-branch-push-guard.ts
|
|
4950
5067
|
function checkDeadBranchPush(input) {
|
|
4951
5068
|
const { branch, prState, prNumber } = input;
|
|
@@ -5125,6 +5242,11 @@ function checkDispatchReadiness(input) {
|
|
|
5125
5242
|
push("depends-on-unresolvable", `dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
|
|
5126
5243
|
continue;
|
|
5127
5244
|
}
|
|
5245
|
+
if (dep.readFailed === true) {
|
|
5246
|
+
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5247
|
+
push("depends-on-read-failed", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, but the forge could not be read for that dependency — not a claim about its merge status. Retry the check.`);
|
|
5248
|
+
continue;
|
|
5249
|
+
}
|
|
5128
5250
|
if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
|
|
5129
5251
|
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5130
5252
|
push("depends-on-not-merged", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
|
|
@@ -5707,6 +5829,7 @@ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
|
5707
5829
|
|
|
5708
5830
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5709
5831
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5832
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
5710
5833
|
var ROLE_VALUES = [
|
|
5711
5834
|
"planner",
|
|
5712
5835
|
"developer",
|
|
@@ -5800,6 +5923,9 @@ var envelopeTail = {
|
|
|
5800
5923
|
var ReviewFindingSchema = z3.object({
|
|
5801
5924
|
id: z3.string(),
|
|
5802
5925
|
severity: z3.string(),
|
|
5926
|
+
location: z3.string().optional(),
|
|
5927
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
5928
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
5803
5929
|
state: z3.string().optional(),
|
|
5804
5930
|
severity_scale: z3.string().optional(),
|
|
5805
5931
|
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
@@ -5855,7 +5981,8 @@ var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
|
5855
5981
|
z3.object({
|
|
5856
5982
|
...dispatchShared,
|
|
5857
5983
|
event: z3.literal("dispatch_failed"),
|
|
5858
|
-
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
5984
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
5985
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
5859
5986
|
usage: dispatchUsageField
|
|
5860
5987
|
}).strict()
|
|
5861
5988
|
]);
|
|
@@ -7255,6 +7382,10 @@ var COMMANDS = [
|
|
|
7255
7382
|
{
|
|
7256
7383
|
flag: "--agent <claude|codex|gemini>",
|
|
7257
7384
|
description: "Vendor for the developer and both reviewers this run dispatches"
|
|
7385
|
+
},
|
|
7386
|
+
{
|
|
7387
|
+
flag: "--quiet",
|
|
7388
|
+
description: "Hide the detail lines (an agent's prose, full commands, failed-result tails) on the live terminal; the driver log file keeps them"
|
|
7258
7389
|
}
|
|
7259
7390
|
],
|
|
7260
7391
|
details: [
|
|
@@ -7268,7 +7399,14 @@ var COMMANDS = [
|
|
|
7268
7399
|
{
|
|
7269
7400
|
name: "task status",
|
|
7270
7401
|
description: "Every open task with a frozen brief, its pull request, and whether its loop is running, paused, or published",
|
|
7271
|
-
flags: [
|
|
7402
|
+
flags: [
|
|
7403
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" },
|
|
7404
|
+
{
|
|
7405
|
+
flag: "--follow",
|
|
7406
|
+
description: "Tail the task's driver log live, with its detail lines, on either the `<tranche> <n>` form or `--issue <n>`"
|
|
7407
|
+
},
|
|
7408
|
+
{ flag: "--quiet", description: "With `--follow`, hide the detail lines; the log file is unchanged" }
|
|
7409
|
+
],
|
|
7272
7410
|
details: [
|
|
7273
7411
|
"Read-only: one `gh issue list` for every open task Issue across every tranche (title/label resolved through the same `resolveTaskIssueRef` `list-tasks.ts` already uses), the open pull request per branch, and the driver pid record / pause record / publish effect markers under `<outboxRoot>/dev-review-loop/<task>/` — never a `ps` scan, never a re-parse of posted verdict comments to decide `published`.",
|
|
7274
7412
|
"`running` names the driver's pid (`review-validity-v1` task 7's pid record); `paused` names the reason from the pause record; `published` means the newest round's reviewer and security verdict effect markers both read `posted`; `no driver` is the fallback when none of the above holds.",
|
|
@@ -7304,6 +7442,26 @@ var COMMANDS = [
|
|
|
7304
7442
|
],
|
|
7305
7443
|
status: "shipped"
|
|
7306
7444
|
},
|
|
7445
|
+
{
|
|
7446
|
+
name: "task-tools result-proof",
|
|
7447
|
+
description: "Prove, live on this host, that a CLI delivers the Developer's turn result as its own structured final output",
|
|
7448
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
7449
|
+
details: [
|
|
7450
|
+
"Runs real Developer-shaped dispatches on this host — the driver-run dev-tools registered and called, the agent's own sandbox where the host supports it, the subscription login, and the dispatch's own argv — and asks for the versioned `DeveloperTurnResult` (`completed`, `blocked` or `needs_ruling`) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`, with the dispatch's Stop hook plus one that rejects the first stop; Codex `--output-schema` under `exec --json` and `exec resume --json`.",
|
|
7451
|
+
"Cases: a first and a resumed session (the same provider session, a fresh result, exactly one accepted); a schema-valid but semantically invalid result (an unknown finding id, a ruling request naming no permissible decision), which the driver rejects; malformed output, which never reaches the driver; and a cancelled run, a provider error and context exhaustion, each ending with no accepted result. Each case prints whether a schema-valid result reached the driver, the result, and the event it was read from; exits 1 when any case fails. Never publishes, opens a pull request or writes the forge."
|
|
7452
|
+
],
|
|
7453
|
+
status: "shipped"
|
|
7454
|
+
},
|
|
7455
|
+
{
|
|
7456
|
+
name: "task-tools review-result-proof",
|
|
7457
|
+
description: "Prove, live on this host, that a CLI delivers a reviewer's result as its own structured final output, concurrent and fresh",
|
|
7458
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
7459
|
+
details: [
|
|
7460
|
+
"Runs real reviewer-shaped dispatches on this host — fresh, non-resumed sessions, the agent's own sandbox where the host supports it, the subscription login, read-only grants, and the staged diff and review-input manifest — and asks for the versioned `ReviewResult` (`completed` or `blocked`, bound to the controller's role, head and manifest digest) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`; Codex `--output-schema` under `exec --json`. Both the code-reviewer and the security-reviewer role run, concurrently against one manifest, each accepted result attributed to its own role.",
|
|
7461
|
+
"Cases: a role mismatch, a wrong head and a wrong manifest digest; an objective id outside the brief, a severity outside the role's scale and a finding without a file (all refused) and a finding without a line (accepted); and a blocked, malformed, missing, cancelled, provider-error and context-exhausted outcome, each recorded as no review, never approval. Each case prints whether a schema-valid result reached the driver and what the controller made of it; exits 1 when any case fails. Never writes the forge and leaves the loop's reviewer dispatch and result files untouched."
|
|
7462
|
+
],
|
|
7463
|
+
status: "shipped"
|
|
7464
|
+
},
|
|
7307
7465
|
{
|
|
7308
7466
|
name: "pr create",
|
|
7309
7467
|
description: "Open a pull request after full brief-schema validation",
|
|
@@ -8130,6 +8288,8 @@ var REGISTRY = [
|
|
|
8130
8288
|
timeoutMs: 15000,
|
|
8131
8289
|
env: {
|
|
8132
8290
|
BASE_SHA: { optional: true },
|
|
8291
|
+
GIT_INDEX_FILE: { optional: true },
|
|
8292
|
+
VINAYA_COMMIT_HOOK: { optional: true },
|
|
8133
8293
|
PR_BODY: { optional: true },
|
|
8134
8294
|
PR_BODY_FILE: { optional: true },
|
|
8135
8295
|
PR_NUMBER: { optional: true },
|