@attalabs/vinaya 0.40.0 → 0.41.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/contracts/developer-reviewer.md +2 -2
- package/aeg-root/contracts/planner-developer.md +4 -4
- package/aeg-root/process.md +3 -3
- package/aeg-root/roles/developer/reference.md +3 -0
- package/aeg-root/state-machine.md +2 -2
- package/aeg-root/templates/brief-template.md +1 -1
- package/dist/checks/bin/check-body-bare-digits.js +165 -65
- package/dist/checks/bin/check-branch-topology.js +169 -60
- package/dist/checks/bin/check-brief-shape.js +165 -65
- package/dist/checks/bin/check-changeset-coverage.js +342 -122
- package/dist/checks/bin/check-ci-shard-coverage.js +384 -130
- package/dist/checks/bin/check-closes-n.js +169 -60
- package/dist/checks/bin/check-coherence.js +165 -65
- package/dist/checks/bin/check-dead-branch-push.js +142 -59
- package/dist/checks/bin/check-dispatch-readiness.js +211 -81
- package/dist/checks/bin/check-doc-claims.js +165 -65
- package/dist/checks/bin/check-doc-coverage-push.js +342 -122
- package/dist/checks/bin/check-doc-coverage.js +344 -124
- package/dist/checks/bin/check-doctrine-no-procedures.js +165 -65
- package/dist/checks/bin/check-doctrine-portability.js +342 -122
- package/dist/checks/bin/check-evidence-fresh.js +376 -129
- package/dist/checks/bin/check-exec-bits.js +342 -122
- package/dist/checks/bin/check-first-push-dispatch.js +208 -78
- package/dist/checks/bin/check-issue-milestone-attach.js +142 -59
- package/dist/checks/bin/check-issue-objectives-numbering.js +165 -65
- package/dist/checks/bin/check-issue-parts-coverage.js +142 -59
- package/dist/checks/bin/check-issue-surface-globs.js +218 -88
- package/dist/checks/bin/check-issue-title-grammar.js +142 -59
- package/dist/checks/bin/check-main-branch-refusal.js +142 -59
- package/dist/checks/bin/check-no-disk-state.js +142 -59
- package/dist/checks/bin/check-pr-premise-reassert.js +165 -65
- package/dist/checks/bin/check-pr-report-density.js +142 -59
- package/dist/checks/bin/check-principal-test-plan-wait.js +165 -65
- package/dist/checks/bin/check-quoted-command.js +338 -118
- package/dist/checks/bin/check-reader-resolvable-prose.js +338 -118
- package/dist/checks/bin/check-registry-gates.js +206 -78
- package/dist/checks/bin/check-retired-vocabulary.js +338 -118
- package/dist/checks/bin/check-review-gate.js +203 -83
- package/dist/checks/bin/check-single-plan-pr.js +142 -59
- package/dist/checks/bin/check-surface-scope.js +169 -60
- package/dist/checks/bin/check-test-plan.js +165 -65
- package/dist/checks/bin/check-token-collection-wired.js +142 -59
- package/dist/checks/bin/check-workspace-escape.js +340 -120
- package/dist/checks/bin/verify-coherence.js +153 -60
- package/dist/checks/bin/verify-dispatch.js +169 -69
- package/dist/checks/bin/verify-docs.js +142 -57
- package/dist/index.js +16280 -11764
- package/dist/lib/pre-push-cache-test-run.js +791 -68
- package/dist/lib/pre-push-changed-files.js +65 -19
- package/dist/lib/pre-push-mode.js +466 -0
- package/dist/lib/pre-push-progress-dir.js +4205 -0
- package/dist/lib/pre-push-record-tests.js +446 -0
- package/dist/lib/pre-push-select-tests.js +1426 -454
- package/dist/lib/push-progress-observer.js +4213 -0
- package/package.json +11 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +18 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +88 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +34 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +26 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +7 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +17 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +13 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +70 -45
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +1 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +77 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +24 -54
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +221 -56
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/live-record.ts +179 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +8 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/narration.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema-digest.ts +225 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +7 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +23 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/principals-config.ts +44 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/prose-rules.ts +532 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/protected-paths.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +157 -80
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +8 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/retired-vocabulary.ts +52 -109
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +46 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +85 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +46 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +2 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +63 -8
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +24 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/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]__08e39jo._.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]__1a3j3n1._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wzfiav._.js → [root-of-the-server]__1d4eth3._.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]__1snpgaw._.js +3 -3
- 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 +2 -2
- 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 +3 -3
- 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/{38kom-9c-oi65.js → 0x7u6si-ai179.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1p3vr9qts86_b.js → 2fu7mfsj4oima.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{21tunzmxjvm2a.js → 34b4ruddunn3q.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attalabs/vinaya",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Vinaya — Agentic Engineering Harness. Deterministic checks every AI coding agent must satisfy before merge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
7
7
|
"author": "Daniel Estevez",
|
|
8
8
|
"bin": {
|
|
9
|
-
"vinaya": "
|
|
10
|
-
"vinaya-select-tests": "
|
|
11
|
-
"vinaya-changed-files": "
|
|
12
|
-
"vinaya-cache-test-run": "
|
|
9
|
+
"vinaya": "dist/index.js",
|
|
10
|
+
"vinaya-select-tests": "dist/lib/pre-push-select-tests.js",
|
|
11
|
+
"vinaya-changed-files": "dist/lib/pre-push-changed-files.js",
|
|
12
|
+
"vinaya-cache-test-run": "dist/lib/pre-push-cache-test-run.js",
|
|
13
|
+
"vinaya-record-tests": "dist/lib/pre-push-record-tests.js",
|
|
14
|
+
"vinaya-push-mode": "dist/lib/pre-push-mode.js",
|
|
15
|
+
"vinaya-push-progress": "dist/lib/pre-push-progress-dir.js",
|
|
16
|
+
"vinaya-push-progress-observer": "dist/lib/push-progress-observer.js"
|
|
13
17
|
},
|
|
14
18
|
"files": [
|
|
15
19
|
"dist",
|
|
@@ -58,9 +62,11 @@
|
|
|
58
62
|
"@atta/adapter-langgraph": "file:tests/fixtures/atta-engine/atta-adapter-langgraph-0.0.1.tgz",
|
|
59
63
|
"@atta/agents": "file:tests/fixtures/atta-engine/atta-agents-0.1.0.tgz",
|
|
60
64
|
"@atta/engine": "file:tests/fixtures/atta-engine/atta-engine-0.0.1.tgz",
|
|
65
|
+
"@atta/executor-agent-spawn": "file:tests/fixtures/atta-engine/atta-executor-agent-spawn-0.1.1.tgz",
|
|
61
66
|
"@atta/models": "file:tests/fixtures/atta-engine/atta-models-0.1.0.tgz",
|
|
62
67
|
"@attalabs/aeg-core": "workspace:*",
|
|
63
68
|
"@attalabs/aeg-forge-state": "workspace:*",
|
|
69
|
+
"@attalabs/aeg-types": "workspace:*",
|
|
64
70
|
"@atta/typescript-config": "workspace:*",
|
|
65
71
|
"@attalabs/vinaya-sources": "workspace:*",
|
|
66
72
|
"@types/bun": "latest",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* **Tier:** 1
|
|
40
40
|
* <!-- AEG:TIER:END -->
|
|
41
41
|
*
|
|
42
|
-
* Deliberately minimal:
|
|
42
|
+
* Deliberately minimal: eight field names, one shape. This is a delimiting
|
|
43
43
|
* convention, not a metadata DSL; resist adding structure to it.
|
|
44
44
|
*
|
|
45
45
|
* `EVIDENCE` (fix/pr-report-emitter) differs from the other five in one way:
|
|
@@ -60,6 +60,8 @@ import { maskCode } from '@attalabs/aeg-forge-state/strip-code'
|
|
|
60
60
|
* — token use is recorded as the Vinaya log's own `usage` event — so nothing
|
|
61
61
|
* writes or reads that anchor any more. An older body that still carries the
|
|
62
62
|
* pair keeps it: no reader here resolves it, and no writer touches it.
|
|
63
|
+
* `LIVE` is the driver's own record of its `[live]` Test plan runs
|
|
64
|
+
* (`live-record.ts`), never hand-typed either; the Test Plan gate reads it.
|
|
63
65
|
*/
|
|
64
66
|
export const ANCHOR_FIELDS = [
|
|
65
67
|
'CLOSES',
|
|
@@ -68,7 +70,8 @@ export const ANCHOR_FIELDS = [
|
|
|
68
70
|
'PREMISE',
|
|
69
71
|
'TEST-PLAN',
|
|
70
72
|
'EVIDENCE',
|
|
71
|
-
'BEYOND-SURFACE'
|
|
73
|
+
'BEYOND-SURFACE',
|
|
74
|
+
'LIVE'
|
|
72
75
|
] as const
|
|
73
76
|
|
|
74
77
|
export type AnchorField = (typeof ANCHOR_FIELDS)[number]
|
|
@@ -255,8 +255,9 @@ export type BriefFacts = {
|
|
|
255
255
|
/**
|
|
256
256
|
* The Issue's `## Test plan` section (`issue-validation.ts`'s
|
|
257
257
|
* `parseIssueTestPlan`), copied into §9 verbatim. `{ kind: 'commands',
|
|
258
|
-
* lines: [], principal: [] }` is the absent-section sentinel — a
|
|
259
|
-
* `commands` plan always carries at least one line
|
|
258
|
+
* lines: [], principal: [], live: [] }` is the absent-section sentinel — a
|
|
259
|
+
* real `commands` plan always carries at least one line, one principal item
|
|
260
|
+
* or one live item.
|
|
260
261
|
*/
|
|
261
262
|
testPlan: IssueTestPlan
|
|
262
263
|
/**
|
|
@@ -874,6 +875,14 @@ function safeFence(lines: string[]): string {
|
|
|
874
875
|
return '`'.repeat(Math.max(3, longest + 1))
|
|
875
876
|
}
|
|
876
877
|
|
|
878
|
+
/** A `[live]` command as a code span one backtick longer than any run inside it, padded when it starts or ends with a backtick — `parseIssueTestPlan` strips exactly this span back off. */
|
|
879
|
+
function liveCodeSpan(cmd: string): string {
|
|
880
|
+
const longest = Math.max(0, ...(cmd.match(/`+/g) ?? []).map((run) => run.length))
|
|
881
|
+
const ticks = '`'.repeat(longest + 1)
|
|
882
|
+
const pad = cmd.startsWith('`') || cmd.endsWith('`') ? ' ' : ''
|
|
883
|
+
return `${ticks}${pad}${cmd}${pad}${ticks}`
|
|
884
|
+
}
|
|
885
|
+
|
|
877
886
|
/**
|
|
878
887
|
* §9 — copied from the Issue's own `## Test plan` section (`facts.testPlan`),
|
|
879
888
|
* never re-derived from the surface file list. `renderBrief`'s missing-fact
|
|
@@ -893,14 +902,18 @@ function renderSection9(facts: BriefFacts): string {
|
|
|
893
902
|
}
|
|
894
903
|
|
|
895
904
|
const principalLines = facts.testPlan.principal.map((p) => `- [ ] **[principal]** ${p}`)
|
|
905
|
+
// A `[live]` item is never a checkbox: the review loop runs it and records
|
|
906
|
+
// the outcome on the pull request, so there is no box for anyone to tick.
|
|
907
|
+
const liveLines = facts.testPlan.live.map((cmd) => `- **[live]** ${liveCodeSpan(cmd)}`)
|
|
896
908
|
const fence = safeFence(facts.testPlan.lines)
|
|
909
|
+
const items = [...principalLines, ...liveLines]
|
|
897
910
|
return [
|
|
898
911
|
'## 9. Test Plan',
|
|
899
912
|
'',
|
|
900
913
|
fence,
|
|
901
914
|
...facts.testPlan.lines,
|
|
902
915
|
fence,
|
|
903
|
-
...(
|
|
916
|
+
...(items.length > 0 ? ['', ...items] : [])
|
|
904
917
|
].join('\n')
|
|
905
918
|
}
|
|
906
919
|
|
|
@@ -1017,7 +1030,8 @@ export function renderBrief(facts: BriefFacts, template: string): RenderResult {
|
|
|
1017
1030
|
if (
|
|
1018
1031
|
facts.testPlan.kind === 'commands' &&
|
|
1019
1032
|
facts.testPlan.lines.length === 0 &&
|
|
1020
|
-
facts.testPlan.principal.length === 0
|
|
1033
|
+
facts.testPlan.principal.length === 0 &&
|
|
1034
|
+
facts.testPlan.live.length === 0
|
|
1021
1035
|
) {
|
|
1022
1036
|
missing.push(`Test plan (Issue has no \`## Test plan\` section — ${cutoverNote})`)
|
|
1023
1037
|
}
|
|
@@ -124,7 +124,7 @@ function testPlanRegion(prBody: string): string {
|
|
|
124
124
|
/**
|
|
125
125
|
* Test Plan — pass iff the body contains the `Test Plan: unit-tests-only`
|
|
126
126
|
* sentinel (bolded or not — see `TEST_PLAN_UNIT_TESTS_ONLY_RE`), OR at least one
|
|
127
|
-
* `**[agent]**`/`**[principal]**`-tagged checklist line. Presence-only: does not
|
|
127
|
+
* `**[agent]**`/`**[principal]**`-tagged checklist line, OR a `**[live]**` item. Presence-only: does not
|
|
128
128
|
* judge whether tags are correctly assigned or whether `unit-tests-only` is
|
|
129
129
|
* justified by the surface map.
|
|
130
130
|
*/
|
|
@@ -144,7 +144,7 @@ export function checkTestPlan(prBody: string): BriefSectionResult {
|
|
|
144
144
|
const located = locateTestPlanSection(prBody)
|
|
145
145
|
const region = located.found ? located.section : prBody
|
|
146
146
|
if (TEST_PLAN_UNIT_TESTS_ONLY_RE.test(region)) return { status: 'pass', errors: [] }
|
|
147
|
-
if (/\*\*\[(?:agent|principal)\]\*\*/.test(region)) return { status: 'pass', errors: [] }
|
|
147
|
+
if (/\*\*\[(?:agent|principal|live)\]\*\*/.test(region)) return { status: 'pass', errors: [] }
|
|
148
148
|
// Fenced-block detection only counts when the section was genuinely
|
|
149
149
|
// LOCATED, never on the whole-body fallback: `testPlanRegion`'s fallback
|
|
150
150
|
// exists so the sentinel/tag checks above still work on a body with no
|
|
@@ -158,7 +158,7 @@ export function checkTestPlan(prBody: string): BriefSectionResult {
|
|
|
158
158
|
return {
|
|
159
159
|
status: 'fail',
|
|
160
160
|
errors: [
|
|
161
|
-
'brief-validation Test Plan: no Test Plan section found — expected `Test Plan: unit-tests-only`, a fenced `[agent]` command list, or at least one `**[agent]**`/`**[principal]**`-tagged
|
|
161
|
+
'brief-validation Test Plan: no Test Plan section found — expected `Test Plan: unit-tests-only`, a fenced `[agent]` command list, or at least one `**[agent]**`/`**[principal]**`/`**[live]**`-tagged item.'
|
|
162
162
|
]
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
type TaskSurfaceFacts
|
|
21
21
|
} from './issue-validation'
|
|
22
22
|
import { parseTaskBranchIdentity } from './task-branch-identity'
|
|
23
|
-
import { isPrincipal
|
|
23
|
+
import { isPrincipal } from './waiver-label'
|
|
24
24
|
import type { ForgeIssue, TaskIssueRef } from '@attalabs/aeg-types'
|
|
25
25
|
import type { GhIssue } from '@attalabs/aeg-forge-state'
|
|
26
26
|
import type { ForgeFacts, Tranche, Task } from './types'
|
|
@@ -150,7 +150,7 @@ export type TrancheFile = {
|
|
|
150
150
|
* is done-but-unprovable, or a broken close, exactly the class this check
|
|
151
151
|
* exists to catch.
|
|
152
152
|
*/
|
|
153
|
-
export function checkA1(entries: TaskEntry[], principalAllowlist: string[]
|
|
153
|
+
export function checkA1(entries: TaskEntry[], principalAllowlist: string[]): CheckResult {
|
|
154
154
|
const failures: CheckFailure[] = []
|
|
155
155
|
for (const e of entries) {
|
|
156
156
|
if (!e.facts) continue
|
|
@@ -188,15 +188,28 @@ function readRecord<T>(path: string, parse: (raw: string | undefined) => ParsedR
|
|
|
188
188
|
* the co-tenant threat (a genuinely different account) this function exists
|
|
189
189
|
* to catch, and group is not the bit `/tmp`'s own convention polices either.
|
|
190
190
|
*
|
|
191
|
+
* **Overflow owner.** `trustedOverflowUid`, when given, is one more trusted
|
|
192
|
+
* owner — the kernel overflow uid, which every host uid a Linux user
|
|
193
|
+
* namespace leaves unmapped reads as from inside it (root's `/`, `/tmp`
|
|
194
|
+
* included). `mkdirNoSymlinks` passes it only for segments strictly above
|
|
195
|
+
* its `trustedRoot`, and only when `processTrustedOverflowUid` found root
|
|
196
|
+
* unmapped: at or below `trustedRoot` a co-tenant's directory reads as the
|
|
197
|
+
* same overflow uid, so trusting it there would accept exactly the plant this
|
|
198
|
+
* check exists to catch. The mode rule applies to it unchanged.
|
|
199
|
+
*
|
|
191
200
|
* Split out from `mkdirNoSymlinks` so the foreign-owner branch — not
|
|
192
201
|
* constructible as a real fixture in CI without a second local user — stays
|
|
193
202
|
* unit-testable against a faked stat, the same convention
|
|
194
203
|
* `metering-io-guard.test.ts`'s `isTrustedMeteringStat` suite already uses;
|
|
195
204
|
* the mode branch is a real, constructible fixture (`local.test.ts`).
|
|
196
205
|
*/
|
|
197
|
-
export function isTrustedDirStat(
|
|
206
|
+
export function isTrustedDirStat(
|
|
207
|
+
stat: { uid: number; mode: number },
|
|
208
|
+
ownUid: number | undefined,
|
|
209
|
+
trustedOverflowUid?: number
|
|
210
|
+
): boolean {
|
|
198
211
|
if (typeof ownUid !== 'number') return true
|
|
199
|
-
if (stat.uid !== ownUid && stat.uid !== 0) return false
|
|
212
|
+
if (stat.uid !== ownUid && stat.uid !== 0 && stat.uid !== trustedOverflowUid) return false
|
|
200
213
|
const worldWritable = (stat.mode & 0o002) !== 0
|
|
201
214
|
const sticky = (stat.mode & 0o1000) !== 0
|
|
202
215
|
return !worldWritable || sticky
|
|
@@ -206,6 +219,74 @@ function currentUid(): number | undefined {
|
|
|
206
219
|
return typeof process.getuid === 'function' ? process.getuid() : undefined
|
|
207
220
|
}
|
|
208
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Whether a `/proc/self/uid_map` body leaves root unmapped: every line
|
|
224
|
+
* (`inside outside count`) parses, at least one does, and no inside range
|
|
225
|
+
* `[inside, inside + count)` contains `0`. The host's identity map
|
|
226
|
+
* (`0 0 4294967295`) maps root, so it answers `false`; an empty or malformed
|
|
227
|
+
* map answers `false` too — trusting the overflow uid needs a map that
|
|
228
|
+
* positively shows root unmapped, never the absence of one.
|
|
229
|
+
*/
|
|
230
|
+
export function uidMapLeavesRootUnmapped(uidMap: string): boolean {
|
|
231
|
+
const lines = uidMap
|
|
232
|
+
.split('\n')
|
|
233
|
+
.map((line) => line.trim())
|
|
234
|
+
.filter((line) => line.length > 0)
|
|
235
|
+
if (lines.length === 0) return false
|
|
236
|
+
for (const line of lines) {
|
|
237
|
+
const fields = line.split(/\s+/)
|
|
238
|
+
if (fields.length !== 3 || !fields.every((field) => /^\d+$/.test(field))) return false
|
|
239
|
+
const inside = Number(fields[0])
|
|
240
|
+
const count = Number(fields[2])
|
|
241
|
+
if (inside === 0 && count > 0) return false
|
|
242
|
+
}
|
|
243
|
+
return true
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The overflow uid `isTrustedDirStat` may trust above `trustedRoot`, read
|
|
248
|
+
* through `readFile` from `/proc/self/uid_map` and
|
|
249
|
+
* `/proc/sys/kernel/overflowuid` — or `undefined`, today's rule, whenever
|
|
250
|
+
* root is mapped, either file cannot be read (no `/proc` at all on macOS),
|
|
251
|
+
* or the overflow uid does not parse.
|
|
252
|
+
*/
|
|
253
|
+
export function readTrustedOverflowUid(readFile: (path: string) => string): number | undefined {
|
|
254
|
+
try {
|
|
255
|
+
if (!uidMapLeavesRootUnmapped(readFile('/proc/self/uid_map'))) return undefined
|
|
256
|
+
const overflow = readFile('/proc/sys/kernel/overflowuid').trim()
|
|
257
|
+
return /^\d+$/.test(overflow) ? Number(overflow) : undefined
|
|
258
|
+
} catch {
|
|
259
|
+
return undefined
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
let cachedTrustedOverflowUid: { value: number | undefined } | undefined
|
|
264
|
+
|
|
265
|
+
/** `readTrustedOverflowUid` against the real `/proc`, read once per process — a process never changes user namespace mid-run. */
|
|
266
|
+
function processTrustedOverflowUid(): number | undefined {
|
|
267
|
+
cachedTrustedOverflowUid ??= { value: readTrustedOverflowUid((path) => readFileSync(path, 'utf8')) }
|
|
268
|
+
return cachedTrustedOverflowUid.value
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The walk's one zone split: segment `index` of the walked path sits at or
|
|
273
|
+
* below `trustedRoot` (whose own index is `rootSegmentCount - 1`), or
|
|
274
|
+
* strictly above it. Both the symlink rule and the overflow-owner rule in
|
|
275
|
+
* `mkdirNoSymlinks` read it.
|
|
276
|
+
*/
|
|
277
|
+
export function isAtOrBelowTrustedRoot(index: number, rootSegmentCount: number): boolean {
|
|
278
|
+
return index >= rootSegmentCount - 1
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** The overflow uid `mkdirNoSymlinks` hands `isTrustedDirStat` for one segment: never at or below `trustedRoot`. */
|
|
282
|
+
export function segmentTrustedOverflowUid(
|
|
283
|
+
index: number,
|
|
284
|
+
rootSegmentCount: number,
|
|
285
|
+
trustedOverflowUid: number | undefined
|
|
286
|
+
): number | undefined {
|
|
287
|
+
return isAtOrBelowTrustedRoot(index, rootSegmentCount) ? undefined : trustedOverflowUid
|
|
288
|
+
}
|
|
289
|
+
|
|
209
290
|
/**
|
|
210
291
|
* Creates `dir` and every missing ancestor, refusing to traverse through a
|
|
211
292
|
* pre-existing symlink — or a pre-existing real directory with an untrusted
|
|
@@ -260,13 +341,15 @@ export function mkdirNoSymlinks(dir: string, mode: number, trustedRoot: string):
|
|
|
260
341
|
.filter((s) => s.length > 0)
|
|
261
342
|
const segments = absolute.split(sep).filter((s) => s.length > 0)
|
|
262
343
|
const ownUid = currentUid()
|
|
344
|
+
const trustedOverflowUid = typeof ownUid === 'number' ? processTrustedOverflowUid() : undefined
|
|
263
345
|
let current = absolute.startsWith(sep) ? sep : ''
|
|
264
346
|
segments.forEach((segment, index) => {
|
|
265
347
|
current = current === '' || current === sep ? `${current}${segment}` : `${current}${sep}${segment}`
|
|
266
348
|
// `trustedRoot` itself sits at index `rootSegments.length - 1` — at or
|
|
267
349
|
// below it, refusal is unconditional; strictly above it, a symlink is
|
|
268
350
|
// resolved and its real target trust-checked instead of refused outright.
|
|
269
|
-
const atOrBelowTrustedRoot = index
|
|
351
|
+
const atOrBelowTrustedRoot = isAtOrBelowTrustedRoot(index, rootSegments.length)
|
|
352
|
+
const overflowUid = segmentTrustedOverflowUid(index, rootSegments.length, trustedOverflowUid)
|
|
270
353
|
try {
|
|
271
354
|
mkdirSync(current, { mode })
|
|
272
355
|
} catch (err) {
|
|
@@ -292,7 +375,7 @@ export function mkdirNoSymlinks(dir: string, mode: number, trustedRoot: string):
|
|
|
292
375
|
`control-store: refusing to create a run directory through ${current} — it is a symlink that does not resolve to a real directory`
|
|
293
376
|
)
|
|
294
377
|
}
|
|
295
|
-
if (!isTrustedDirStat(real, ownUid)) {
|
|
378
|
+
if (!isTrustedDirStat(real, ownUid, overflowUid)) {
|
|
296
379
|
throw new Error(
|
|
297
380
|
`control-store: refusing to create a run directory through ${current} — its symlink target is owned by uid ${real.uid} with mode ${(real.mode & 0o7777).toString(8)}, neither this process's own user nor a safe shared mode`
|
|
298
381
|
)
|
|
@@ -304,7 +387,7 @@ export function mkdirNoSymlinks(dir: string, mode: number, trustedRoot: string):
|
|
|
304
387
|
`control-store: refusing to create a run directory through ${current} — it already exists and is not a real directory (a symlink or a file)`
|
|
305
388
|
)
|
|
306
389
|
}
|
|
307
|
-
if (!isTrustedDirStat(stat, ownUid)) {
|
|
390
|
+
if (!isTrustedDirStat(stat, ownUid, overflowUid)) {
|
|
308
391
|
throw new Error(
|
|
309
392
|
`control-store: refusing to create a run directory through ${current} — it already exists, owned by uid ${stat.uid} with mode ${(stat.mode & 0o7777).toString(8)}, neither this process's own user nor a safe shared mode`
|
|
310
393
|
)
|
|
@@ -149,6 +149,18 @@ export const ManifestRecordSchema = z
|
|
|
149
149
|
objectivesVersion: z.string().min(1).nullable(),
|
|
150
150
|
/** Rulings — the newest principal ruling ordinal at dispatch (`0` when none). */
|
|
151
151
|
rulingOrdinal: epochNumber,
|
|
152
|
+
/** Review-manifest protocol version; unknown values are corrupt. */
|
|
153
|
+
manifestVersion: z.literal(2).optional(),
|
|
154
|
+
/** Principal ruling bound to the resumed pause, or explicit null. */
|
|
155
|
+
pauseBoundRuling: z
|
|
156
|
+
.object({
|
|
157
|
+
rulingId: z.string().min(1),
|
|
158
|
+
pauseId: z.string().min(1),
|
|
159
|
+
contentDigest: z.string().min(1)
|
|
160
|
+
})
|
|
161
|
+
.strict()
|
|
162
|
+
.nullable()
|
|
163
|
+
.optional(),
|
|
152
164
|
/** Policy identity — the complete effective review policy's digest. */
|
|
153
165
|
policyDigest: z.string().min(1),
|
|
154
166
|
recordedAt: isoTimestamp
|
|
@@ -216,12 +228,32 @@ export const LoopStateRecordSchema = z
|
|
|
216
228
|
* the developer at a finding or a failure that had in fact already
|
|
217
229
|
* repeated, the exact outcome the two repeat stops exist to prevent.
|
|
218
230
|
* Optional: a record written before this field existed still parses, and
|
|
219
|
-
* reads back as no memory rather than as a corrupt record.
|
|
231
|
+
* reads back as no memory rather than as a corrupt record. The same holds
|
|
232
|
+
* for `lastFailure.developerAttemptedSince`: absent reads as no Developer
|
|
233
|
+
* attempt recorded since that failure.
|
|
220
234
|
*/
|
|
221
235
|
repeatMemory: z
|
|
222
236
|
.object({
|
|
223
237
|
blockingFindings: z.array(z.string()),
|
|
224
|
-
lastFailure: z
|
|
238
|
+
lastFailure: z
|
|
239
|
+
.object({ signature: z.string(), message: z.string(), developerAttemptedSince: z.boolean().optional() })
|
|
240
|
+
.nullable()
|
|
241
|
+
})
|
|
242
|
+
.strict()
|
|
243
|
+
.optional(),
|
|
244
|
+
/**
|
|
245
|
+
* What the next Developer packet is built from, so a restarted or
|
|
246
|
+
* re-exec'd driver builds the same packet the one before it would have:
|
|
247
|
+
* the newest review's unresolved findings, each with the controller-
|
|
248
|
+
* computed id the Developer cites and the finding line it was handed, and
|
|
249
|
+
* the checks that failed on the newest gate read. Overwritten as each
|
|
250
|
+
* changes. Optional: a record written before this field existed reads
|
|
251
|
+
* back as nothing handed over.
|
|
252
|
+
*/
|
|
253
|
+
developerHandoff: z
|
|
254
|
+
.object({
|
|
255
|
+
findings: z.array(z.object({ id: z.string().min(1), description: z.string().min(1) }).strict()),
|
|
256
|
+
failingChecks: z.array(z.string().min(1))
|
|
225
257
|
})
|
|
226
258
|
.strict()
|
|
227
259
|
.optional(),
|
package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts
CHANGED
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
* stop a loop that is repeating itself rather than converging: the same
|
|
38
38
|
* BLOCKING finding — same reviewer role, same file, same description — still open in
|
|
39
39
|
* two consecutive reviewed rounds (`condition: 'repeat_finding'`), and two
|
|
40
|
-
* consecutive attempts ending on the same mechanical failure
|
|
41
|
-
* (`condition: 'repeat_failure'`).
|
|
40
|
+
* consecutive attempts ending on the same mechanical failure, with a
|
|
41
|
+
* finished Developer attempt between them (`condition: 'repeat_failure'`).
|
|
42
|
+
* Neither revives `no_progress`: a round
|
|
42
43
|
* that resolves nothing but raises only new findings still continues, and
|
|
43
44
|
* a round whose repeated finding is non-blocking continues too. Both name
|
|
44
45
|
* what repeated in the pause's own `detail`.
|
|
@@ -468,15 +469,36 @@ const VOLATILE_TOKENS: readonly { pattern: RegExp; replacement: string }[] = [
|
|
|
468
469
|
* the previous attempt's. Shared by both observation kinds that can carry a
|
|
469
470
|
* mechanical failure, so a repeat means the same thing whether or not the
|
|
470
471
|
* attempt produced a head.
|
|
472
|
+
*
|
|
473
|
+
* A matching signature is a repeat only when a Developer attempt finished
|
|
474
|
+
* since the previous failure was recorded (`recordDeveloperAttempt`). The
|
|
475
|
+
* same red gate read again after a retry that never reached the Developer —
|
|
476
|
+
* a dispatch that failed on infrastructure, then resumed — is the same
|
|
477
|
+
* attempt's failure read twice, and sends the Developer instead of pausing.
|
|
471
478
|
*/
|
|
472
479
|
function matchFailure(
|
|
473
480
|
state: LoopState,
|
|
474
481
|
reported: string | undefined
|
|
475
|
-
): { failure:
|
|
482
|
+
): { failure: NonNullable<LoopState['lastFailure']> | null; repeat: boolean } {
|
|
476
483
|
const message = reported?.trim() ?? ''
|
|
477
484
|
const signature = message === '' ? '' : normalizeFailureSignature(message)
|
|
478
485
|
if (signature === '') return { failure: null, repeat: false }
|
|
479
|
-
return {
|
|
486
|
+
return {
|
|
487
|
+
failure: { signature, message, developerAttemptedSince: false },
|
|
488
|
+
repeat: state.lastFailure?.signature === signature && state.lastFailure.developerAttemptedSince === true
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Records that a Developer attempt finished: the failure the loop last
|
|
494
|
+
* recorded now has an attempt after it, so the same failure read again is a
|
|
495
|
+
* second attempt's. The driver calls this when a Developer turn returns; a
|
|
496
|
+
* dispatch that failed before reaching the Developer never calls it. A state
|
|
497
|
+
* with no recorded failure is returned unchanged.
|
|
498
|
+
*/
|
|
499
|
+
export function recordDeveloperAttempt(state: LoopState): LoopState {
|
|
500
|
+
if (state.lastFailure === null || state.lastFailure.developerAttemptedSince === true) return state
|
|
501
|
+
return { ...state, lastFailure: { ...state.lastFailure, developerAttemptedSince: true } }
|
|
480
502
|
}
|
|
481
503
|
|
|
482
504
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* process, a file, or the forge.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { assessRound } from './assess-round'
|
|
9
|
+
import { assessRound, recordDeveloperAttempt } from './assess-round'
|
|
10
10
|
import type {
|
|
11
11
|
Confidence,
|
|
12
12
|
Decision,
|
|
@@ -104,6 +104,11 @@ export function notMetVerdict(role: 'reviewer' | 'security', objectiveIds: strin
|
|
|
104
104
|
* time grows between observations. Omitted, no clock is passed at all, which
|
|
105
105
|
* is exactly a caller that cannot measure the task's first start: the time
|
|
106
106
|
* budget is then never armed and every existing scenario behaves as before.
|
|
107
|
+
*
|
|
108
|
+
* A `dispatch_developer` decision is followed by a finished Developer attempt
|
|
109
|
+
* before the next step, recorded with `recordDeveloperAttempt` exactly as the
|
|
110
|
+
* driver records one. A scenario whose dispatch never reaches the Developer
|
|
111
|
+
* calls `assessRound` directly instead.
|
|
107
112
|
*/
|
|
108
113
|
export function runScenario(
|
|
109
114
|
initial: LoopState,
|
|
@@ -115,7 +120,7 @@ export function runScenario(
|
|
|
115
120
|
const decisions: Decision[] = []
|
|
116
121
|
for (const [index, step] of steps.entries()) {
|
|
117
122
|
const result = assessRound(state, step, clockAt?.(index))
|
|
118
|
-
state = result.state
|
|
123
|
+
state = result.decision.type === 'dispatch_developer' ? recordDeveloperAttempt(result.state) : result.state
|
|
119
124
|
events.push(...result.events)
|
|
120
125
|
decisions.push(result.decision)
|
|
121
126
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
assessRound,
|
|
3
|
+
recordDeveloperAttempt,
|
|
4
|
+
renderPhaseBreakdown,
|
|
5
|
+
renderTaskBudgetDetail,
|
|
6
|
+
taskBudgetExceeded
|
|
7
|
+
} from './assess-round'
|
|
2
8
|
export { parseSummaryConfidenceRows, renderPublishedMarker } from './render-summary'
|
|
3
9
|
export type { SummaryConfidenceRow } from './render-summary'
|
|
4
10
|
export { initialLoopState } from './types'
|
|
@@ -201,7 +201,7 @@ export type Observations =
|
|
|
201
201
|
* carries the repeated key(s) in the pause's own `detail`.
|
|
202
202
|
*
|
|
203
203
|
* `'repeat_failure'`: two consecutive attempts ended on the same mechanical
|
|
204
|
-
* failure — a refused push, a premise re-check mismatch, a forge or network
|
|
204
|
+
* failure, with a finished Developer attempt between them — a refused push, a premise re-check mismatch, a forge or network
|
|
205
205
|
* error, a failed pre-push test — matched by the normalised signature
|
|
206
206
|
* `normalizeFailureSignature` derives (`assess-round.ts`), never by raw
|
|
207
207
|
* string equality: the volatile parts of such a message (timestamps,
|
|
@@ -239,6 +239,15 @@ export type Observations =
|
|
|
239
239
|
* probe's own error. It is outside the automatic-recovery set and spends no
|
|
240
240
|
* infrastructure retry; once the host is repaired, the ordinary start
|
|
241
241
|
* continues the task from it, recording the pause's resolution once.
|
|
242
|
+
*
|
|
243
|
+
* `'missing_source'`: a required source the frozen brief names could not be
|
|
244
|
+
* prepared before the Developer's turn — a page behind a login, a page that
|
|
245
|
+
* answered from another host or with no document, a repository path absent
|
|
246
|
+
* at the frozen base, or a source naming neither — so the turn never starts
|
|
247
|
+
* and the run never continues on model memory in its place. Driver-decided
|
|
248
|
+
* by the controller's source provider; `detail` names each unavailable
|
|
249
|
+
* source with its typed reason (`RequiredSourceMissingReason`). Addressed to
|
|
250
|
+
* the Planner, whose correction of the task's sources is what resolves it.
|
|
242
251
|
*/
|
|
243
252
|
export type PauseReason =
|
|
244
253
|
| 'escalation'
|
|
@@ -257,6 +266,7 @@ export type PauseReason =
|
|
|
257
266
|
| 'brief_superseded'
|
|
258
267
|
| 'policy_changed'
|
|
259
268
|
| 'sandbox_refused'
|
|
269
|
+
| 'missing_source'
|
|
260
270
|
|
|
261
271
|
export type Decision =
|
|
262
272
|
| { type: 'dispatch_developer'; reason?: 'confidence' }
|
|
@@ -425,8 +435,13 @@ export type LoopState = {
|
|
|
425
435
|
* (what two attempts are matched on) and the `message` as reported (what
|
|
426
436
|
* the pause names). `null` whenever the last attempt reached a green gate,
|
|
427
437
|
* or failed with no reported cause: either breaks the repeat chain.
|
|
438
|
+
* `developerAttemptedSince` is `true` once a Developer attempt finished
|
|
439
|
+
* after this failure was recorded (`recordDeveloperAttempt`): only then is
|
|
440
|
+
* the same failure read again a second attempt's failure rather than the
|
|
441
|
+
* same attempt's read twice. Absent — a record written before this field
|
|
442
|
+
* existed — reads as no attempt recorded.
|
|
428
443
|
*/
|
|
429
|
-
lastFailure: { signature: string; message: string } | null
|
|
444
|
+
lastFailure: { signature: string; message: string; developerAttemptedSince?: boolean } | null
|
|
430
445
|
/** Running sums for `journal_finalized` — updated once per concluded round, never recomputed from `rounds` (which carries counts only, not diff stats). */
|
|
431
446
|
totalWallMs: number
|
|
432
447
|
totalFilesChanged: number
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* line per failure, naming the exact task/Issue/PR involved.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import type { PriorTrancheArchivalFact } from '@attalabs/aeg-forge-state'
|
|
21
22
|
import { edgesNameEachOther } from './issue-validation'
|
|
22
23
|
|
|
23
24
|
/** The one edge reader both gates use — the write gate's own function, re-exposed so a test can assert identity. */
|
|
@@ -40,7 +41,7 @@ export function siblingsSharingConflictEdge<S extends ConflictEdgeParty>(
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
import type { Task } from './types'
|
|
43
|
-
import { isPrincipal
|
|
44
|
+
import { isPrincipal } from './waiver-label'
|
|
44
45
|
|
|
45
46
|
export type DispatchIssueFact = { number: number; state: 'open' | 'closed' } | null
|
|
46
47
|
|
|
@@ -132,12 +133,8 @@ export type DispatchPriorTaskFact = {
|
|
|
132
133
|
hasProvenance: boolean
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
/** null when this project has no prior tranche at all — the gate passes trivially for it. */
|
|
138
|
-
priorTrancheSlug: string | null
|
|
139
|
-
archived: boolean
|
|
140
|
-
}
|
|
136
|
+
/** One entry per project a task names — the shape `resolvePriorTrancheArchival` returns, defined beside the reads that produce it. */
|
|
137
|
+
export type DispatchPriorTrancheFact = PriorTrancheArchivalFact
|
|
141
138
|
|
|
142
139
|
export type DispatchGateInput = {
|
|
143
140
|
trancheSlug: string
|
|
@@ -158,16 +155,15 @@ export type DispatchGateInput = {
|
|
|
158
155
|
/** One entry per project named in `task.projects`. */
|
|
159
156
|
priorTrancheArchival: DispatchPriorTrancheFact[]
|
|
160
157
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* hand-close path.
|
|
158
|
+
* The Principal list for hand-close recognition — the repository's own
|
|
159
|
+
* `vinaya.config.json` `principals` field, resolved by the caller before
|
|
160
|
+
* calling in (never read from here; this stays pure). REQUIRED, with no
|
|
161
|
+
* built-in fallback, same as `checkReviewGate`'s `principalAllowlist`
|
|
162
|
+
* (`review-gate.ts`) — hardcoding this repo's own principal made that gate
|
|
163
|
+
* unpassable on any adopter repo; the same mistake here would silently do
|
|
164
|
+
* the same to the hand-close path.
|
|
169
165
|
*/
|
|
170
|
-
principalAllowlist
|
|
166
|
+
principalAllowlist: string[]
|
|
171
167
|
}
|
|
172
168
|
|
|
173
169
|
/**
|
|
@@ -242,7 +238,7 @@ function isSelfDependency(dep: DispatchDependsOnFact, task: Task, issue: Dispatc
|
|
|
242
238
|
export function checkDispatchReadiness(input: DispatchGateInput): DispatchResult {
|
|
243
239
|
const { trancheSlug, task } = input
|
|
244
240
|
const taskLabel = `task ${task.id} (tranche ${trancheSlug})`
|
|
245
|
-
const principalAllowlist = input
|
|
241
|
+
const { principalAllowlist } = input
|
|
246
242
|
const blockerDetails: DispatchBlocker[] = []
|
|
247
243
|
const push = (blockerClass: DispatchBlockerClass, message: string): void => {
|
|
248
244
|
blockerDetails.push({ class: blockerClass, message })
|
|
@@ -28,4 +28,4 @@ export {
|
|
|
28
28
|
SHORT_VERSION_MIN_WORDS,
|
|
29
29
|
WHAT_YOU_CHECK_HEADING
|
|
30
30
|
} from './published-prose'
|
|
31
|
-
export type { PublishedProseEntry, PublishedProseResult } from './published-prose'
|
|
31
|
+
export type { PublishedProseEntry, PublishedProseOptions, PublishedProseResult } from './published-prose'
|