@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
|
@@ -498,6 +498,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
498
498
|
"html",
|
|
499
499
|
"css"
|
|
500
500
|
]);
|
|
501
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
502
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
501
503
|
|
|
502
504
|
// ../../packages/aeg-core/src/coherence-checks.ts
|
|
503
505
|
var R1_GRANDFATHERED_ISSUES = new Set([279, 280, 281, 282]);
|
|
@@ -787,6 +789,7 @@ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
|
787
789
|
|
|
788
790
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
789
791
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
792
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
790
793
|
var ROLE_VALUES = [
|
|
791
794
|
"planner",
|
|
792
795
|
"developer",
|
|
@@ -880,6 +883,9 @@ var envelopeTail = {
|
|
|
880
883
|
var ReviewFindingSchema = z3.object({
|
|
881
884
|
id: z3.string(),
|
|
882
885
|
severity: z3.string(),
|
|
886
|
+
location: z3.string().optional(),
|
|
887
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
888
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
883
889
|
state: z3.string().optional(),
|
|
884
890
|
severity_scale: z3.string().optional(),
|
|
885
891
|
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
@@ -935,7 +941,8 @@ var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
|
935
941
|
z3.object({
|
|
936
942
|
...dispatchShared,
|
|
937
943
|
event: z3.literal("dispatch_failed"),
|
|
938
|
-
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
944
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
945
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
939
946
|
usage: dispatchUsageField
|
|
940
947
|
}).strict()
|
|
941
948
|
]);
|
|
@@ -1789,6 +1796,8 @@ var REGISTRY = [
|
|
|
1789
1796
|
timeoutMs: 15000,
|
|
1790
1797
|
env: {
|
|
1791
1798
|
BASE_SHA: { optional: true },
|
|
1799
|
+
GIT_INDEX_FILE: { optional: true },
|
|
1800
|
+
VINAYA_COMMIT_HOOK: { optional: true },
|
|
1792
1801
|
PR_BODY: { optional: true },
|
|
1793
1802
|
PR_BODY_FILE: { optional: true },
|
|
1794
1803
|
PR_NUMBER: { optional: true },
|
|
@@ -4196,6 +4205,10 @@ var COMMANDS = [
|
|
|
4196
4205
|
{
|
|
4197
4206
|
flag: "--agent <claude|codex|gemini>",
|
|
4198
4207
|
description: "Vendor for the developer and both reviewers this run dispatches"
|
|
4208
|
+
},
|
|
4209
|
+
{
|
|
4210
|
+
flag: "--quiet",
|
|
4211
|
+
description: "Hide the detail lines (an agent's prose, full commands, failed-result tails) on the live terminal; the driver log file keeps them"
|
|
4199
4212
|
}
|
|
4200
4213
|
],
|
|
4201
4214
|
details: [
|
|
@@ -4209,7 +4222,14 @@ var COMMANDS = [
|
|
|
4209
4222
|
{
|
|
4210
4223
|
name: "task status",
|
|
4211
4224
|
description: "Every open task with a frozen brief, its pull request, and whether its loop is running, paused, or published",
|
|
4212
|
-
flags: [
|
|
4225
|
+
flags: [
|
|
4226
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" },
|
|
4227
|
+
{
|
|
4228
|
+
flag: "--follow",
|
|
4229
|
+
description: "Tail the task's driver log live, with its detail lines, on either the `<tranche> <n>` form or `--issue <n>`"
|
|
4230
|
+
},
|
|
4231
|
+
{ flag: "--quiet", description: "With `--follow`, hide the detail lines; the log file is unchanged" }
|
|
4232
|
+
],
|
|
4213
4233
|
details: [
|
|
4214
4234
|
"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`.",
|
|
4215
4235
|
"`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.",
|
|
@@ -4245,6 +4265,26 @@ var COMMANDS = [
|
|
|
4245
4265
|
],
|
|
4246
4266
|
status: "shipped"
|
|
4247
4267
|
},
|
|
4268
|
+
{
|
|
4269
|
+
name: "task-tools result-proof",
|
|
4270
|
+
description: "Prove, live on this host, that a CLI delivers the Developer's turn result as its own structured final output",
|
|
4271
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
4272
|
+
details: [
|
|
4273
|
+
"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`.",
|
|
4274
|
+
"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."
|
|
4275
|
+
],
|
|
4276
|
+
status: "shipped"
|
|
4277
|
+
},
|
|
4278
|
+
{
|
|
4279
|
+
name: "task-tools review-result-proof",
|
|
4280
|
+
description: "Prove, live on this host, that a CLI delivers a reviewer's result as its own structured final output, concurrent and fresh",
|
|
4281
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
4282
|
+
details: [
|
|
4283
|
+
"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.",
|
|
4284
|
+
"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."
|
|
4285
|
+
],
|
|
4286
|
+
status: "shipped"
|
|
4287
|
+
},
|
|
4248
4288
|
{
|
|
4249
4289
|
name: "pr create",
|
|
4250
4290
|
description: "Open a pull request after full brief-schema validation",
|
|
@@ -154,29 +154,34 @@ function resolveRemoteBase(repoRoot) {
|
|
|
154
154
|
return "origin/main";
|
|
155
155
|
return "HEAD~1";
|
|
156
156
|
}
|
|
157
|
-
function changedFilesSinceRemoteBase(repoRoot) {
|
|
158
|
-
const base = resolveRemoteBase(repoRoot);
|
|
157
|
+
function changedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
159
158
|
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=ACMR", `${base}...HEAD`]);
|
|
160
159
|
return out.split(`
|
|
161
160
|
`).map((s) => s.trim()).filter(Boolean);
|
|
162
161
|
}
|
|
163
|
-
function changedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
164
|
-
return changedFilesSinceRemoteBase(repoRoot).map((f) => join(repoRoot, f));
|
|
162
|
+
function changedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
163
|
+
return changedFilesSinceRemoteBase(repoRoot, base).map((f) => join(repoRoot, f));
|
|
165
164
|
}
|
|
166
|
-
function addedOrRenamedFilesSinceRemoteBase(repoRoot) {
|
|
167
|
-
const base = resolveRemoteBase(repoRoot);
|
|
165
|
+
function addedOrRenamedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
168
166
|
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=AR", `${base}...HEAD`]);
|
|
169
167
|
return out.split(`
|
|
170
168
|
`).map((s) => s.trim()).filter(Boolean);
|
|
171
169
|
}
|
|
172
|
-
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
173
|
-
return addedOrRenamedFilesSinceRemoteBase(repoRoot).map((f) => join(repoRoot, f));
|
|
170
|
+
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
171
|
+
return addedOrRenamedFilesSinceRemoteBase(repoRoot, base).map((f) => join(repoRoot, f));
|
|
174
172
|
}
|
|
175
|
-
function
|
|
176
|
-
const
|
|
173
|
+
function removedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
174
|
+
const out = git(repoRoot, ["diff", "--name-status", "--diff-filter=DR", `${base}...HEAD`]);
|
|
175
|
+
return out.split(`
|
|
176
|
+
`).map((line) => line.split("\t")).filter((fields) => fields.length >= 2).map((fields) => fields[1].trim()).filter(Boolean);
|
|
177
|
+
}
|
|
178
|
+
function removedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
179
|
+
return removedFilesSinceRemoteBase(repoRoot, base).map((f) => join(repoRoot, f));
|
|
180
|
+
}
|
|
181
|
+
function changedFileDiffsSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
177
182
|
const mergeBase = git(repoRoot, ["merge-base", base, "HEAD"]) || base;
|
|
178
183
|
const out = [];
|
|
179
|
-
for (const relative of changedFilesSinceRemoteBase(repoRoot)) {
|
|
184
|
+
for (const relative of changedFilesSinceRemoteBase(repoRoot, base)) {
|
|
180
185
|
const patch = git(repoRoot, ["diff", "-U0", `${mergeBase}..HEAD`, "--", relative]);
|
|
181
186
|
const { beforeRanges, afterRanges } = parseHunkRanges(patch);
|
|
182
187
|
out.push({
|
|
@@ -602,6 +602,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
602
602
|
"html",
|
|
603
603
|
"css"
|
|
604
604
|
]);
|
|
605
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
606
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
605
607
|
|
|
606
608
|
// ../../packages/aeg-core/src/coherence-checks.ts
|
|
607
609
|
var R1_GRANDFATHERED_ISSUES = new Set([279, 280, 281, 282]);
|
|
@@ -891,6 +893,7 @@ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
|
891
893
|
|
|
892
894
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
893
895
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
896
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
894
897
|
var ROLE_VALUES = [
|
|
895
898
|
"planner",
|
|
896
899
|
"developer",
|
|
@@ -984,6 +987,9 @@ var envelopeTail = {
|
|
|
984
987
|
var ReviewFindingSchema = z3.object({
|
|
985
988
|
id: z3.string(),
|
|
986
989
|
severity: z3.string(),
|
|
990
|
+
location: z3.string().optional(),
|
|
991
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
992
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
987
993
|
state: z3.string().optional(),
|
|
988
994
|
severity_scale: z3.string().optional(),
|
|
989
995
|
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
@@ -1039,7 +1045,8 @@ var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
|
1039
1045
|
z3.object({
|
|
1040
1046
|
...dispatchShared,
|
|
1041
1047
|
event: z3.literal("dispatch_failed"),
|
|
1042
|
-
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
1048
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
1049
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
1043
1050
|
usage: dispatchUsageField
|
|
1044
1051
|
}).strict()
|
|
1045
1052
|
]);
|
|
@@ -2339,29 +2346,34 @@ function resolveRemoteBase(repoRoot) {
|
|
|
2339
2346
|
return "origin/main";
|
|
2340
2347
|
return "HEAD~1";
|
|
2341
2348
|
}
|
|
2342
|
-
function changedFilesSinceRemoteBase(repoRoot) {
|
|
2343
|
-
const base = resolveRemoteBase(repoRoot);
|
|
2349
|
+
function changedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2344
2350
|
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=ACMR", `${base}...HEAD`]);
|
|
2345
2351
|
return out.split(`
|
|
2346
2352
|
`).map((s) => s.trim()).filter(Boolean);
|
|
2347
2353
|
}
|
|
2348
|
-
function changedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
2349
|
-
return changedFilesSinceRemoteBase(repoRoot).map((f) => join3(repoRoot, f));
|
|
2354
|
+
function changedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2355
|
+
return changedFilesSinceRemoteBase(repoRoot, base).map((f) => join3(repoRoot, f));
|
|
2350
2356
|
}
|
|
2351
|
-
function addedOrRenamedFilesSinceRemoteBase(repoRoot) {
|
|
2352
|
-
const base = resolveRemoteBase(repoRoot);
|
|
2357
|
+
function addedOrRenamedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2353
2358
|
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=AR", `${base}...HEAD`]);
|
|
2354
2359
|
return out.split(`
|
|
2355
2360
|
`).map((s) => s.trim()).filter(Boolean);
|
|
2356
2361
|
}
|
|
2357
|
-
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
2358
|
-
return addedOrRenamedFilesSinceRemoteBase(repoRoot).map((f) => join3(repoRoot, f));
|
|
2362
|
+
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2363
|
+
return addedOrRenamedFilesSinceRemoteBase(repoRoot, base).map((f) => join3(repoRoot, f));
|
|
2359
2364
|
}
|
|
2360
|
-
function
|
|
2361
|
-
const
|
|
2365
|
+
function removedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2366
|
+
const out = git(repoRoot, ["diff", "--name-status", "--diff-filter=DR", `${base}...HEAD`]);
|
|
2367
|
+
return out.split(`
|
|
2368
|
+
`).map((line) => line.split("\t")).filter((fields) => fields.length >= 2).map((fields) => fields[1].trim()).filter(Boolean);
|
|
2369
|
+
}
|
|
2370
|
+
function removedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2371
|
+
return removedFilesSinceRemoteBase(repoRoot, base).map((f) => join3(repoRoot, f));
|
|
2372
|
+
}
|
|
2373
|
+
function changedFileDiffsSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2362
2374
|
const mergeBase = git(repoRoot, ["merge-base", base, "HEAD"]) || base;
|
|
2363
2375
|
const out = [];
|
|
2364
|
-
for (const relative of changedFilesSinceRemoteBase(repoRoot)) {
|
|
2376
|
+
for (const relative of changedFilesSinceRemoteBase(repoRoot, base)) {
|
|
2365
2377
|
const patch = git(repoRoot, ["diff", "-U0", `${mergeBase}..HEAD`, "--", relative]);
|
|
2366
2378
|
const { beforeRanges, afterRanges } = parseHunkRanges(patch);
|
|
2367
2379
|
out.push({
|
|
@@ -2612,6 +2624,123 @@ function scannedRootsOf(ts, file, source, repoRoot) {
|
|
|
2612
2624
|
return [];
|
|
2613
2625
|
return roots.filter((r) => !roots.some((other) => other !== r && r.startsWith(`${other}/`))).sort();
|
|
2614
2626
|
}
|
|
2627
|
+
var SCANNER_DECLARATIONS = [
|
|
2628
|
+
{
|
|
2629
|
+
test: "apps/cli/tests/conformance/dev-review-engine-architecture-exit.test.ts",
|
|
2630
|
+
roots: [
|
|
2631
|
+
"apps/cli/tests/fixtures/dev-review-engine-scenarios.json",
|
|
2632
|
+
"apps/cli/tests/fixtures/dev-review-architecture-invariants.json",
|
|
2633
|
+
"apps/cli/tests/fixtures/dev-review-engine-capability-matrix.json",
|
|
2634
|
+
"apps/cli/src/commands/dev-review-loop.ts",
|
|
2635
|
+
"apps/cli/src/lib/dev-review-loop.ts",
|
|
2636
|
+
"apps/cli/src/lib/dev-review-loop/",
|
|
2637
|
+
"packages/aeg-core/src/dev-review-loop/"
|
|
2638
|
+
],
|
|
2639
|
+
trigger: "listed-files"
|
|
2640
|
+
},
|
|
2641
|
+
{ test: "apps/cli/tests/ci-shards.test.ts", roots: ["apps/cli/"], trigger: "tree-shape" },
|
|
2642
|
+
{
|
|
2643
|
+
test: "apps/cli/tests/conformance/dev-review-invariant-coverage.test.ts",
|
|
2644
|
+
roots: [
|
|
2645
|
+
"apps/cli/src/commands/dev-review-loop.ts",
|
|
2646
|
+
"apps/cli/src/lib/dev-review-loop.ts",
|
|
2647
|
+
"apps/cli/src/lib/dev-review-loop/",
|
|
2648
|
+
"packages/aeg-core/src/dev-review-loop/",
|
|
2649
|
+
"apps/cli/tests/commands/dev-review-loop.test.ts",
|
|
2650
|
+
"apps/cli/tests/lib/dev-review-loop"
|
|
2651
|
+
],
|
|
2652
|
+
trigger: "tree-shape"
|
|
2653
|
+
},
|
|
2654
|
+
{ test: "apps/cli/tests/platform-independence.test.ts", roots: ["apps/cli/tests/"], trigger: "content" },
|
|
2655
|
+
{ test: "apps/cli/tests/process-fixture-coverage.test.ts", roots: ["apps/cli/tests/"], trigger: "process-start" },
|
|
2656
|
+
{ test: "apps/cli/scripts/bundle-doctrine.test.ts", roots: ["."], trigger: "content" },
|
|
2657
|
+
{ test: "apps/cli/tests/checks/bin-permissions.test.ts", roots: ["."], trigger: "content" },
|
|
2658
|
+
{
|
|
2659
|
+
test: "apps/cli/tests/checks/registry-gates.test.ts",
|
|
2660
|
+
roots: [
|
|
2661
|
+
"apps/cli/src/",
|
|
2662
|
+
"packages/aeg-core/bin/",
|
|
2663
|
+
"packages/aeg-core/src/brief-validation.ts",
|
|
2664
|
+
"aeg-root/enforcement.md",
|
|
2665
|
+
".claude/hooks/"
|
|
2666
|
+
],
|
|
2667
|
+
trigger: "content"
|
|
2668
|
+
},
|
|
2669
|
+
{
|
|
2670
|
+
test: "apps/cli/tests/checks/shipped-bin-audience.test.ts",
|
|
2671
|
+
roots: ["apps/cli/src/checks/bin/"],
|
|
2672
|
+
trigger: "content"
|
|
2673
|
+
},
|
|
2674
|
+
{ test: "apps/cli/tests/commands/sync.test.ts", roots: ["apps/cli/src/commands/sync.ts"], trigger: "content" },
|
|
2675
|
+
{ test: "apps/cli/tests/doctrine.test.ts", roots: ["apps/cli/src/index.ts"], trigger: "content" },
|
|
2676
|
+
{ test: "apps/cli/tests/import-boundary.test.ts", roots: ["apps/cli/"], trigger: "content" },
|
|
2677
|
+
{
|
|
2678
|
+
test: "apps/cli/tests/lib/log-entry-paths.test.ts",
|
|
2679
|
+
roots: [".github/workflows/", ".vinaya/hooks/", ".claude/settings.json", "vinaya.config.json"],
|
|
2680
|
+
trigger: "content"
|
|
2681
|
+
},
|
|
2682
|
+
{ test: "apps/cli/tests/lib/log-callers.test.ts", roots: ["."], trigger: "content" },
|
|
2683
|
+
{
|
|
2684
|
+
test: "apps/cli/tests/lib/log-sink-no-sync-spawn.test.ts",
|
|
2685
|
+
roots: ["apps/cli/src/lib/log-sink.ts"],
|
|
2686
|
+
trigger: "content"
|
|
2687
|
+
},
|
|
2688
|
+
{ test: "apps/cli/tests/lib/no-log-forge-writes.test.ts", roots: ["."], trigger: "content" },
|
|
2689
|
+
{
|
|
2690
|
+
test: "apps/cli/tests/log-destination-isolation.test.ts",
|
|
2691
|
+
roots: ["apps/cli/src/", "apps/cli/tests/"],
|
|
2692
|
+
trigger: "content"
|
|
2693
|
+
},
|
|
2694
|
+
{ test: `apps/cli/tests/no-brief-${"author"}.test.ts`, roots: ["."], trigger: "content" },
|
|
2695
|
+
{ test: "apps/cli/tests/run-paths-only.test.ts", roots: ["."], trigger: "content" },
|
|
2696
|
+
{ test: "apps/cli/tests/surface-index.test.ts", roots: ["apps/cli/src/commands/"], trigger: "content" },
|
|
2697
|
+
{ test: "apps/cli/tests/surface-spec-exports.test.ts", roots: ["apps/cli/src/commands/"], trigger: "content" },
|
|
2698
|
+
{ test: "packages/aeg-core/src/actions.test.ts", roots: ["aeg-root/roles/"], trigger: "content" },
|
|
2699
|
+
{ test: "packages/aeg-core/src/diagram-model.test.ts", roots: ["."], trigger: "content" },
|
|
2700
|
+
{
|
|
2701
|
+
test: "packages/aeg-core/src/docs/docs-coherence.test.ts",
|
|
2702
|
+
roots: ["packages/aeg-core/tests/fixtures/docs-coherence/"],
|
|
2703
|
+
trigger: "content"
|
|
2704
|
+
},
|
|
2705
|
+
{ test: "packages/aeg-core/src/docs/node-route.test.ts", roots: ["."], trigger: "content" },
|
|
2706
|
+
{ test: "packages/aeg-core/src/gate-audience.test.ts", roots: ["packages/aeg-core/bin/"], trigger: "content" },
|
|
2707
|
+
{ test: "packages/aeg-core/src/no-binary-sources.test.ts", roots: ["."], trigger: "content" },
|
|
2708
|
+
{ test: "packages/aeg-core/src/retired-vocabulary.test.ts", roots: ["."], trigger: "content" }
|
|
2709
|
+
];
|
|
2710
|
+
function underDeclaredRoot(path, root) {
|
|
2711
|
+
return root === "." || path.startsWith(root);
|
|
2712
|
+
}
|
|
2713
|
+
var PROCESS_CALLS = new Set([...SPAWN_CALLS, "fork"]);
|
|
2714
|
+
function startsProcessIn(ts, file, source, ranges) {
|
|
2715
|
+
let sourceFile;
|
|
2716
|
+
try {
|
|
2717
|
+
sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.ES2022, true);
|
|
2718
|
+
} catch {
|
|
2719
|
+
return false;
|
|
2720
|
+
}
|
|
2721
|
+
const touched = (node) => {
|
|
2722
|
+
if (!ranges)
|
|
2723
|
+
return true;
|
|
2724
|
+
const first = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
|
|
2725
|
+
const last = sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line + 1;
|
|
2726
|
+
return ranges.some((r) => r.start <= last && r.end >= first);
|
|
2727
|
+
};
|
|
2728
|
+
let found = false;
|
|
2729
|
+
const visit = (node) => {
|
|
2730
|
+
if (found)
|
|
2731
|
+
return;
|
|
2732
|
+
if (ts.isCallExpression(node)) {
|
|
2733
|
+
const callee = ts.isIdentifier(node.expression) ? node.expression.text : ts.isPropertyAccessExpression(node.expression) && node.expression.name.text !== "exec" ? node.expression.name.text : "";
|
|
2734
|
+
if (PROCESS_CALLS.has(callee) && touched(node)) {
|
|
2735
|
+
found = true;
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
ts.forEachChild(node, visit);
|
|
2740
|
+
};
|
|
2741
|
+
ts.forEachChild(sourceFile, visit);
|
|
2742
|
+
return found;
|
|
2743
|
+
}
|
|
2615
2744
|
|
|
2616
2745
|
// src/lib/ts-module-graph.ts
|
|
2617
2746
|
import { createRequire } from "node:module";
|
|
@@ -3510,6 +3639,23 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
|
|
|
3510
3639
|
edges.set(key, [...edges.get(key) ?? [], edge]);
|
|
3511
3640
|
}
|
|
3512
3641
|
}
|
|
3642
|
+
const triggeredScanners = new Set;
|
|
3643
|
+
const relative = (f) => isAbsolute4(f) ? f.slice(repoRoot.length + 1) : f;
|
|
3644
|
+
const reshaped = [...addedOrRenamed, ...options.removed ?? []].map(relative);
|
|
3645
|
+
const changedRanges = new Map([...options.changedRanges ?? new Map].map(([f, ranges]) => [isAbsolute4(f) ? f : join7(repoRoot, f), ranges]));
|
|
3646
|
+
for (const declaration of options.scannerDeclarations ?? SCANNER_DECLARATIONS) {
|
|
3647
|
+
const under = (f) => declaration.roots.some((root) => underDeclaredRoot(f, root));
|
|
3648
|
+
const triggered = declaration.trigger === "tree-shape" ? reshaped.some(under) : declaration.trigger === "process-start" ? [...absChanged].some((abs) => {
|
|
3649
|
+
if (!/\.tsx?$/.test(abs) || !under(relative(abs)))
|
|
3650
|
+
return false;
|
|
3651
|
+
if (!typescript)
|
|
3652
|
+
return true;
|
|
3653
|
+
const ranges = addedOrRenamed.has(abs) ? undefined : changedRanges.get(abs);
|
|
3654
|
+
return startsProcessIn(typescript, abs, readSource(abs), ranges);
|
|
3655
|
+
}) : declaration.trigger === "listed-files" ? [...absChanged, ...addedOrRenamed, ...options.removed ?? []].map(relative).some(under) : false;
|
|
3656
|
+
if (triggered)
|
|
3657
|
+
triggeredScanners.add(join7(repoRoot, declaration.test));
|
|
3658
|
+
}
|
|
3513
3659
|
const anythingChanged = absChanged.size > 0 || changedPackageNames.size > 0;
|
|
3514
3660
|
const selected = [];
|
|
3515
3661
|
let totalTestFiles = 0;
|
|
@@ -3520,7 +3666,7 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
|
|
|
3520
3666
|
continue;
|
|
3521
3667
|
const maxDepth = options.depth === "one" ? 1 : Number.POSITIVE_INFINITY;
|
|
3522
3668
|
for (const test of testFiles) {
|
|
3523
|
-
const forced = alwaysRunRegexes.some((re) => re.test(test.slice(repoRoot.length + 1))) || addedOrRenamed.has(test) || rootConfigChanged && pkg === cliPackage;
|
|
3669
|
+
const forced = alwaysRunRegexes.some((re) => re.test(test.slice(repoRoot.length + 1))) || addedOrRenamed.has(test) || triggeredScanners.has(test) || rootConfigChanged && pkg === cliPackage;
|
|
3524
3670
|
if (forced || anythingChanged && reaches(`${ALL_PREFIX}${test}`, edges, changeFacts, maxDepth)) {
|
|
3525
3671
|
selected.push(test);
|
|
3526
3672
|
}
|
|
@@ -3582,21 +3728,31 @@ function reaches(start, edges, changed, maxDepth = Number.POSITIVE_INFINITY) {
|
|
|
3582
3728
|
return false;
|
|
3583
3729
|
}
|
|
3584
3730
|
|
|
3585
|
-
// src/lib/pre-push-
|
|
3586
|
-
function
|
|
3587
|
-
const
|
|
3588
|
-
const
|
|
3589
|
-
const
|
|
3590
|
-
const addedOrRenamed = addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot);
|
|
3731
|
+
// src/lib/pre-push-selection.ts
|
|
3732
|
+
function prePushSelection(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
3733
|
+
const changed = changedFilesSinceRemoteBaseAbsolute(repoRoot, base);
|
|
3734
|
+
const addedOrRenamed = addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot, base);
|
|
3735
|
+
const removed = removedFilesSinceRemoteBaseAbsolute(repoRoot, base);
|
|
3591
3736
|
const alwaysRun = loadConfig()?.prePush?.alwaysRun ?? [];
|
|
3592
3737
|
const typescript = loadTypeScript(repoRoot);
|
|
3593
|
-
const
|
|
3594
|
-
const
|
|
3738
|
+
const diffs = typescript ? changedFileDiffsSinceRemoteBase(repoRoot, base) : undefined;
|
|
3739
|
+
const names = typescript && diffs ? affectedNames(typescript, diffs) : undefined;
|
|
3740
|
+
const changedRanges = diffs ? new Map(diffs.map((d) => [d.file, d.afterRanges])) : undefined;
|
|
3741
|
+
return selectAffectedTestFiles(repoRoot, changed, {
|
|
3595
3742
|
alwaysRun,
|
|
3596
3743
|
addedOrRenamed,
|
|
3744
|
+
removed,
|
|
3745
|
+
changedRanges,
|
|
3597
3746
|
affectedNames: names,
|
|
3598
3747
|
depth: "one"
|
|
3599
3748
|
});
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
// src/lib/pre-push-select-tests.ts
|
|
3752
|
+
function main() {
|
|
3753
|
+
const repoRoot = process.cwd();
|
|
3754
|
+
const started = performance.now();
|
|
3755
|
+
const { selected, totalTestFiles, resolver, programMs } = prePushSelection(repoRoot);
|
|
3600
3756
|
const elapsed = performance.now() - started;
|
|
3601
3757
|
for (const file of selected)
|
|
3602
3758
|
process.stdout.write(`${file}
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
* Deliberately minimal: seven field names, one shape. This is a delimiting
|
|
43
43
|
* convention, not a metadata DSL; resist adding structure to it.
|
|
44
44
|
*
|
|
45
|
-
* `EVIDENCE` (fix/pr-report-emitter) differs from the other
|
|
45
|
+
* `EVIDENCE` (fix/pr-report-emitter) differs from the other five in one way:
|
|
46
46
|
* it is never hand-typed. `vinaya pr report --write` is the only writer, and
|
|
47
47
|
* `check-evidence-fresh` is the only reader — no prose-fallback recognition
|
|
48
48
|
* exists or is planned for this field, unlike the anchor-optional grammar
|
|
@@ -52,12 +52,13 @@
|
|
|
52
52
|
import { maskCode } from '@attalabs/aeg-forge-state/strip-code'
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* The
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* The six gate-read fields with an anchored home. A `TOKENS` entry belonged
|
|
56
|
+
* here while a pull-request body carried a token table; that table is retired
|
|
57
|
+
* — token use is recorded as the Vinaya log's own `usage` event — so nothing
|
|
58
|
+
* writes or reads that anchor any more. An older body that still carries the
|
|
59
|
+
* pair keeps it: no reader here resolves it, and no writer touches it.
|
|
59
60
|
*/
|
|
60
|
-
export const ANCHOR_FIELDS = ['CLOSES', 'PROJECT', 'TIER', 'PREMISE', 'TEST-PLAN', 'EVIDENCE'
|
|
61
|
+
export const ANCHOR_FIELDS = ['CLOSES', 'PROJECT', 'TIER', 'PREMISE', 'TEST-PLAN', 'EVIDENCE'] as const
|
|
61
62
|
|
|
62
63
|
export type AnchorField = (typeof ANCHOR_FIELDS)[number]
|
|
63
64
|
|
|
@@ -657,29 +657,43 @@ function renderSection4(facts: BriefFacts): string {
|
|
|
657
657
|
return lines.join('\n')
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
+
/**
|
|
661
|
+
* O2 : Step 0 runs as-written from the Developer's own working directory,
|
|
662
|
+
* which IS the task worktree the driver created — it neither creates nor even
|
|
663
|
+
* ENTERS one. The driver (`dev-review-loop.ts`'s `createTaskWorktree`) creates
|
|
664
|
+
* `.worktrees/<branch>` and pushes the branch to the remote, FROM that
|
|
665
|
+
* worktree, before the first Developer dispatch ever runs — outside any
|
|
666
|
+
* sandbox, so neither vendor's own filesystem confinement (which denies
|
|
667
|
+
* writing the main checkout's `.git`) stands between a dispatched Developer and
|
|
668
|
+
* a worktree it would otherwise have had to create itself. The dispatched
|
|
669
|
+
* session's `cwd` IS that worktree, so Step 0 no longer starts with `cd
|
|
670
|
+
* .worktrees/<branch> &&` — a leading `cd` would read as entering a
|
|
671
|
+
* `.worktrees/` path that does not exist relative to a cwd already inside it.
|
|
672
|
+
* `bun install` stays in Step 0: a fresh worktree still needs its own
|
|
673
|
+
* `node_modules` before the dispatched session can run its own toolchain.
|
|
674
|
+
*/
|
|
660
675
|
function renderSection5(facts: BriefFacts): string {
|
|
661
|
-
|
|
662
|
-
//
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
//
|
|
666
|
-
|
|
667
|
-
|
|
676
|
+
// Never names the shipped check's or the authoring repository's own
|
|
677
|
+
// fuller derivation as a literal command the Developer runs — the driver
|
|
678
|
+
// runs both itself, from its own unsandboxed process, and stages the
|
|
679
|
+
// result (`dev-review-loop.ts`'s `dispatchDeveloperOnce`); naming the
|
|
680
|
+
// invocation here would read as an instruction to re-run it inside the
|
|
681
|
+
// Developer's own sandbox, where either script's own `gh` call fails
|
|
682
|
+
// (`isolation.md` §4a).
|
|
668
683
|
const unabridged =
|
|
669
684
|
facts.localGateCommands.dispatchReadiness !== null
|
|
670
|
-
?
|
|
685
|
+
? ' plus, on this repository toolchain, its own fuller derivation'
|
|
671
686
|
: ''
|
|
672
687
|
const verifyLine =
|
|
673
|
-
`2. \`${facts.cliInvocation}
|
|
674
|
-
'
|
|
675
|
-
unabridged
|
|
688
|
+
`2. Under \`${facts.cliInvocation} dispatch\`/the review loop, the driver has already run the dispatch-readiness gate${unabridged} from its own unsandboxed process before dispatching you (re-derived at render time: it was ready), and staged the combined verdict in this round's own Developer folder — read it there; either script's own \`gh\` call fails inside your sandbox. Working manually, with no driver behind you, fall back to ` +
|
|
689
|
+
"`roles/developer.md`'s own items 3/5/7 prose — each a complete, hand-run forge check in its own right."
|
|
676
690
|
const lines = [
|
|
677
691
|
'## 5. Pre-flight checks',
|
|
678
692
|
'',
|
|
679
693
|
'**Step 0 (mandatory, verbatim):**',
|
|
680
694
|
'',
|
|
681
695
|
'```',
|
|
682
|
-
|
|
696
|
+
'bun install --frozen-lockfile --silent',
|
|
683
697
|
'```',
|
|
684
698
|
'',
|
|
685
699
|
'1. Clean status; parent `origin/main`; branch suffix literal-matches the task id.',
|
|
@@ -764,7 +778,11 @@ function renderSection6(facts: BriefFacts): string {
|
|
|
764
778
|
return lines.join('\n')
|
|
765
779
|
})
|
|
766
780
|
|
|
767
|
-
return [
|
|
781
|
+
return [
|
|
782
|
+
'## 6. Numbered parts — call `publish_changes` after EACH part; `open_pull_request` once the first part is published',
|
|
783
|
+
'',
|
|
784
|
+
...rendered
|
|
785
|
+
].join('\n')
|
|
768
786
|
}
|
|
769
787
|
|
|
770
788
|
function renderSection7(section7Pointers: string[]): string {
|
|
@@ -801,7 +819,7 @@ function renderSection8(facts: BriefFacts): string {
|
|
|
801
819
|
// never a command a check or `pr report` executes — `evidence-fresh`
|
|
802
820
|
// re-running it under the twenty-six sibling checks CI had just built
|
|
803
821
|
// deleted their own `dist` out from under them.
|
|
804
|
-
|
|
822
|
+
"- The pre-push hook already ran the affected suite on your one push and refused it on failure — do not additionally run it yourself; the `refresh_evidence` tool regenerates the PR body's Evidence block for the current head, re-running the checks it attests to record their command and output there.",
|
|
805
823
|
"- The full `bun run test` suite is CI's to run, on the one push — never run it locally.",
|
|
806
824
|
'- Every blast-radius consumer named in §4, re-verified by name.',
|
|
807
825
|
`- The tier checklist in \`${facts.cliInvocation} doctrine --role developer --print\` genuinely satisfied, and ${docGateCommand(facts)}.`
|
|
@@ -895,7 +913,7 @@ function renderSection12(facts: BriefFacts): string {
|
|
|
895
913
|
'## 12. Deliverable',
|
|
896
914
|
'',
|
|
897
915
|
`- PR title (exact): \`${prTitle}\``,
|
|
898
|
-
|
|
916
|
+
'- Open the PR only via the `open_pull_request` tool (title and body); publish your commits with `publish_changes` and update the body with `update_pull_request_body`/`refresh_evidence` — you hold no `gh`/`git push` credential.',
|
|
899
917
|
`- PR body = the Developer's PR report (print it with \`${facts.cliInvocation} doctrine --template pr-report --print\`), with this entire brief pasted as the reference copy inside a collapsed \`<details>\` block, and \`Closes #${facts.issue}\` at the top of the header block.`,
|
|
900
918
|
`- Pre-open gate: tier checklist satisfied, and ${docGateCommand(facts)}.`,
|
|
901
919
|
'- Include `git diff main --stat` and a token report (if unavailable, state so).',
|