@attalabs/vinaya 0.31.0 → 0.33.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/README.md +2 -3
- package/aeg-root/contracts/principal-operator.md +18 -5
- package/aeg-root/roles/developer/reference.md +3 -3
- package/aeg-root/roles/operator.md +69 -16
- package/aeg-root/roles/planner/reference.md +1 -1
- package/aeg-root/roles/tranche-archivist.md +1 -0
- package/aeg-root/skills/aeg-context-packets/SKILL.md +1 -1
- package/aeg-root/skills/aeg-context-packets/examples/operator-start.md +1 -1
- package/aeg-root/templates/pr-report-template.md +7 -2
- package/dist/checks/bin/check-body-bare-digits.js +340 -101
- package/dist/checks/bin/check-branch-topology.js +184 -105
- package/dist/checks/bin/check-brief-shape.js +333 -94
- package/dist/checks/bin/check-changeset-coverage.js +1028 -248
- package/dist/checks/bin/check-ci-shard-coverage.js +82 -0
- package/dist/checks/bin/check-closes-n.js +184 -105
- package/dist/checks/bin/check-coherence.js +345 -145
- package/dist/checks/bin/check-dead-branch-push.js +179 -59
- package/dist/checks/bin/check-dispatch-readiness.js +350 -150
- package/dist/checks/bin/check-doc-coverage-push.js +1011 -231
- package/dist/checks/bin/check-doc-coverage.js +1015 -235
- package/dist/checks/bin/check-doctrine-no-procedures.js +333 -94
- package/dist/checks/bin/check-doctrine-portability.js +1013 -233
- package/dist/checks/bin/check-evidence-fresh.js +1010 -222
- package/dist/checks/bin/check-exec-bits.js +1009 -229
- package/dist/checks/bin/check-first-push-dispatch.js +343 -145
- package/dist/checks/bin/check-issue-assignment.js +186 -107
- package/dist/checks/bin/check-issue-milestone-attach.js +176 -56
- package/dist/checks/bin/check-issue-objectives-numbering.js +176 -56
- package/dist/checks/bin/check-issue-parts-coverage.js +176 -56
- package/dist/checks/bin/check-issue-surface-globs.js +363 -143
- package/dist/checks/bin/check-issue-title-grammar.js +176 -56
- package/dist/checks/bin/check-issue-tranche-label.js +176 -56
- package/dist/checks/bin/check-main-branch-refusal.js +176 -56
- package/dist/checks/bin/check-no-disk-state.js +176 -56
- package/dist/checks/bin/check-pr-premise-reassert.js +333 -92
- package/dist/checks/bin/check-pr-report-density.js +176 -56
- package/dist/checks/bin/check-principal-test-plan-wait.js +176 -54
- package/dist/checks/bin/check-quoted-command.js +999 -217
- package/dist/checks/bin/check-reader-resolvable-prose.js +1011 -229
- package/dist/checks/bin/check-registry-gates.js +186 -56
- package/dist/checks/bin/check-retired-vocabulary.js +997 -215
- package/dist/checks/bin/check-review-gate.js +403 -203
- package/dist/checks/bin/check-single-plan-pr.js +176 -56
- package/dist/checks/bin/check-surface-scope.js +184 -105
- package/dist/checks/bin/check-test-plan.js +176 -54
- package/dist/checks/bin/check-token-collection-wired.js +182 -57
- package/dist/checks/bin/check-token-report.js +178 -58
- package/dist/checks/bin/check-workspace-escape.js +1011 -229
- package/dist/index.js +5971 -3489
- package/dist/lib/pre-push-cache-test-run.js +4431 -0
- package/dist/lib/pre-push-select-tests.js +799 -110
- package/package.json +3 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/actions.ts +10 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/archive-task.ts +42 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/baseline-capture.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/branch-topology-gate.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +554 -95
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +264 -44
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/claude-code-transcript.ts +9 -9
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +211 -30
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/consumer-enumeration.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +75 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +961 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +212 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/outcomes.ts +135 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +394 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-audit.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-guard.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/derive-section7.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +514 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +110 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +27 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +123 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +27 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +240 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/diagram-model.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/direct-main-push.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +65 -22
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +238 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-owners.ts +14 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/docs-coherence.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/legacy-anchors.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/node-route.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/surfaced-manifest.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-no-procedures.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ensure-label.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/first-push-dispatch-gate.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +14 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +379 -11
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +3 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +1450 -33
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/local-anchor-coverage.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +119 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +75 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/redact.ts +87 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +801 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +373 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/metering-io-guard.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/milestone-validation.ts +2 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/no-disk-state.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +288 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-token-report.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-tranche.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +30 -16
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-tier.ts +17 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/premise-check.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/quoted-command.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +267 -19
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +91 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-scaffold.ts +6 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/report-tokens.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +239 -110
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +384 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +184 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +65 -18
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +76 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/single-plan-pr.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/state-machine-model.ts +40 -27
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/symbol-collisions.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +38 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +488 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +7 -9
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-section.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/types.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +314 -56
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +2 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/workspace-escape.ts +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/{[externals]__1agj1ww._.js → [externals]__0cki-x_._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +6 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +3 -0
- 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]__0r7e54g._.js → [root-of-the-server]__18paley._.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/{[root-of-the-server]__1r47dr7._.js → _08onyya._.js} +3 -3
- 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/_0y1jv16._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_15gdg48._.js +5 -5
- 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/0bjnj-5fy4e7l.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1dc2_-c_gavj1.js → 1ce2dj27_cgbj.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3xg6-flovrcx-.js → 22s44f5k3ecmj.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/34hhdtbp20krb.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0hstap0._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2t_rfsztmwu6y.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3ua4rm5f-a9k6.js +0 -1
- /package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Objectives grammar. Pure — no `fs`,
|
|
3
|
+
* no `fetch`, no `process.env`.
|
|
4
|
+
*
|
|
5
|
+
* A task Issue's `## Objectives` section: numbered `O<n>. <sentence>` lines,
|
|
6
|
+
* one observable outcome each, contiguous from `O1`. This module is the one
|
|
7
|
+
* parser and the one version hash every later consumer reads — the Issue
|
|
8
|
+
* gate (`issue-validation.ts`'s `checkIssueObjectives`), the brief-side
|
|
9
|
+
* copy/coverage gates (`brief-validation.ts`'s `checkObjectivesCopy`/
|
|
10
|
+
* `checkObjectivesCoverage`), and the brief renderer (`brief-render.ts`,
|
|
11
|
+
* copying the Issue's list into a brief via `renderObjectives`).
|
|
12
|
+
*
|
|
13
|
+
* An objective states an observable outcome, never a file path — the Brief
|
|
14
|
+
* Author maps it to files in the brief's own surface map, not here.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { createHash } from 'node:crypto'
|
|
18
|
+
import { maskCode, maskDetailsBlocks } from '@attalabs/aeg-forge-state/strip-code'
|
|
19
|
+
|
|
20
|
+
export type Objective = { id: string; text: string }
|
|
21
|
+
|
|
22
|
+
export type ParsedObjectives = { ok: true; objectives: Objective[] } | { ok: false; errors: string[] }
|
|
23
|
+
|
|
24
|
+
const HEADING_RE = /^##[ \t]*Objectives[ \t]*$/im
|
|
25
|
+
const NEXT_HEADING_RE = /^##[ \t]/m
|
|
26
|
+
const OBJECTIVE_LINE_RE = /^O(\d+)\.[ \t]*(.*)$/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* `body` with every fenced/inline code span and collapsed `<details>` block
|
|
30
|
+
* blanked to same-length filler — index-preserving, so a position found here
|
|
31
|
+
* maps 1:1 onto `body` itself. Composed as `maskDetailsBlocks(maskCode(body))`
|
|
32
|
+
* per `maskDetailsBlocks`'s own documented call order (`strip-code.ts`).
|
|
33
|
+
*
|
|
34
|
+
* Every heading search in this module runs against this masked view, never
|
|
35
|
+
* the raw body: a pull request following this repo's own deliverable
|
|
36
|
+
* template (`aeg-root/templates/pr-report-template.md`) pastes the full,
|
|
37
|
+
* frozen brief — which, for a task with `O<n>.` objectives, always carries
|
|
38
|
+
* its OWN `## Objectives` heading — inside a collapsed `<details>`
|
|
39
|
+
* reference-copy block below the live report. Searching the raw body let
|
|
40
|
+
* that reference-copy heading be mistaken for a live objectives section
|
|
41
|
+
* (found live, security review: `hasObjectivesHeading`/`resolveObjectivesSource`
|
|
42
|
+
* returned true/`{kind:'body'}` for a no-Issue PR carrying only the
|
|
43
|
+
* reference copy, and `objectivesOf` then failed to parse the `</details>`
|
|
44
|
+
* line it hit, refusing a verdict `review post` should have rendered with no
|
|
45
|
+
* objectives block at all). One masked view, used everywhere this module
|
|
46
|
+
* looks for a heading, closes the class rather than the one instance.
|
|
47
|
+
*/
|
|
48
|
+
function maskedForHeadingSearch(body: string): string {
|
|
49
|
+
return maskDetailsBlocks(maskCode(body))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* True iff `text` contains a backticked span with a `/` inside it — one
|
|
54
|
+
* signal an objective may be little more than a bare path. A manual
|
|
55
|
+
* single-pass scan, not a regex: the natural regex shape for this,
|
|
56
|
+
* `` /`[^`\n]*\/[^`\n]*`/ ``, is two unanchored wildcards separated by a
|
|
57
|
+
* literal — quadratic on a line dense with backticks and no closing pair,
|
|
58
|
+
* since the engine restarts the inner scan from every backtick position
|
|
59
|
+
* (a MEDIUM security-review finding). This scan advances past each
|
|
60
|
+
* checked span exactly once, so it stays linear in `text`'s length
|
|
61
|
+
* regardless of how many backtick-shaped characters an attacker packs in.
|
|
62
|
+
*/
|
|
63
|
+
function hasBacktickedPath(text: string): boolean {
|
|
64
|
+
let i = 0
|
|
65
|
+
while (i < text.length) {
|
|
66
|
+
const start = text.indexOf('`', i)
|
|
67
|
+
if (start === -1) return false
|
|
68
|
+
const end = text.indexOf('`', start + 1)
|
|
69
|
+
if (end === -1) return false
|
|
70
|
+
if (text.slice(start + 1, end).includes('/')) return true
|
|
71
|
+
i = end + 1
|
|
72
|
+
}
|
|
73
|
+
return false
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* How many non-path words an objective needs to count as a real sentence
|
|
78
|
+
* rather than a dressed-up path reference. Mentioning a runtime path as
|
|
79
|
+
* supporting detail inside an otherwise complete observable sentence is
|
|
80
|
+
* fine — live task Issues do this routinely (a real Issue's own first
|
|
81
|
+
* objective names an outbox path, later ones each name a source/spec path) — what the grammar
|
|
82
|
+
* refuses is an objective that, once its backticked spans are removed, is
|
|
83
|
+
* left with next to nothing: a path standing in for a sentence.
|
|
84
|
+
*/
|
|
85
|
+
const MIN_WORDS_OUTSIDE_BACKTICKS = 3
|
|
86
|
+
|
|
87
|
+
/** `text` with every backticked span removed — what remains is the sentence, if any, that isn't the path itself. */
|
|
88
|
+
function stripObjectiveBackticks(text: string): string {
|
|
89
|
+
return text.replace(/`[^`\n]*`/g, ' ')
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function wordCount(text: string): number {
|
|
93
|
+
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* `[start, end)` char offsets of the `## Objectives` section — from its
|
|
98
|
+
* heading line to the next `##` heading, or the end of `body` — or `null`
|
|
99
|
+
* when no heading is found. `objectivesSectionText` and
|
|
100
|
+
* `body-bare-digits-logic.ts`'s `O<n>.`-prefix exemption (task-run-v1, O2)
|
|
101
|
+
* both locate the identical span through this one function, so the two
|
|
102
|
+
* can never disagree on where the section starts or ends.
|
|
103
|
+
*/
|
|
104
|
+
export function objectivesSectionBounds(body: string): { start: number; end: number } | null {
|
|
105
|
+
const masked = maskedForHeadingSearch(body)
|
|
106
|
+
const heading = HEADING_RE.exec(masked)
|
|
107
|
+
if (!heading) return null
|
|
108
|
+
const start = heading.index + heading[0].length
|
|
109
|
+
const afterHeading = masked.slice(start)
|
|
110
|
+
const next = NEXT_HEADING_RE.exec(afterHeading)
|
|
111
|
+
return { start, end: next ? start + next.index : body.length }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The `## Objectives` section's raw text (from its heading line to the next `##` heading, or the end), or `null` when no heading is found. */
|
|
115
|
+
function objectivesSectionText(body: string): string | null {
|
|
116
|
+
const bounds = objectivesSectionBounds(body)
|
|
117
|
+
return bounds === null ? null : body.slice(bounds.start, bounds.end)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* True when `body` carries a `## Objectives` heading at all, regardless of
|
|
122
|
+
* whether the section under it parses. Callers that decide WHETHER the
|
|
123
|
+
* objectives checks apply at all (a standalone brief with no task Issue to
|
|
124
|
+
* compare against, `verify-brief.ts`/`check-brief-shape.ts`) use this to
|
|
125
|
+
* distinguish "no section attempted — not required" from "a section exists
|
|
126
|
+
* and must parse" — `objectivesOf` alone conflates the two into one
|
|
127
|
+
* `ok: false`.
|
|
128
|
+
*/
|
|
129
|
+
export function hasObjectivesHeading(body: string): boolean {
|
|
130
|
+
return HEADING_RE.test(maskedForHeadingSearch(body))
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Parses a `## Objectives` section into its numbered lines. Refuses — never
|
|
135
|
+
* silently drops — a missing heading, a line that isn't `O<n>. <sentence>`
|
|
136
|
+
* shaped (an `O1:` or `1.` line), an objective with no sentence, a sentence
|
|
137
|
+
* naming a file path in backticks, or numbering that isn't contiguous from
|
|
138
|
+
* `O1`.
|
|
139
|
+
*/
|
|
140
|
+
export function objectivesOf(body: string): ParsedObjectives {
|
|
141
|
+
const section = objectivesSectionText(body)
|
|
142
|
+
if (section === null) {
|
|
143
|
+
return { ok: false, errors: ['no `## Objectives` heading found in the body.'] }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const lines = section
|
|
147
|
+
.split(/\r?\n/)
|
|
148
|
+
.map((l) => l.trim())
|
|
149
|
+
.filter((l) => l.length > 0)
|
|
150
|
+
|
|
151
|
+
if (lines.length === 0) {
|
|
152
|
+
return { ok: false, errors: ['the `## Objectives` section has no `O<n>.` lines.'] }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const objectives: Objective[] = []
|
|
156
|
+
const errors: string[] = []
|
|
157
|
+
|
|
158
|
+
for (const line of lines) {
|
|
159
|
+
const m = OBJECTIVE_LINE_RE.exec(line)
|
|
160
|
+
if (!m) {
|
|
161
|
+
errors.push(`"${line}" is not a well-formed objective line — expected \`O<n>. <sentence>\`, e.g. \`O1. …\`.`)
|
|
162
|
+
continue
|
|
163
|
+
}
|
|
164
|
+
const n = m[1] as string
|
|
165
|
+
const text = (m[2] as string).trim()
|
|
166
|
+
if (text.length === 0) {
|
|
167
|
+
errors.push(`O${n} has no sentence — every objective is one observable sentence.`)
|
|
168
|
+
continue
|
|
169
|
+
}
|
|
170
|
+
if (hasBacktickedPath(text) && wordCount(stripObjectiveBackticks(text)) < MIN_WORDS_OUTSIDE_BACKTICKS) {
|
|
171
|
+
errors.push(
|
|
172
|
+
`O${n} is little more than a file path — an objective states an observable outcome, never a bare path (the Planner maps it to files).`
|
|
173
|
+
)
|
|
174
|
+
continue
|
|
175
|
+
}
|
|
176
|
+
objectives.push({ id: `O${n}`, text })
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
for (let i = 0; i < objectives.length; i++) {
|
|
180
|
+
const expected = i + 1
|
|
181
|
+
const actual = Number.parseInt((objectives[i] as Objective).id.slice(1), 10)
|
|
182
|
+
if (actual !== expected) {
|
|
183
|
+
errors.push(
|
|
184
|
+
`numbering is not contiguous from O1 — expected O${expected}, found ${(objectives[i] as Objective).id}.`
|
|
185
|
+
)
|
|
186
|
+
break
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (errors.length > 0) return { ok: false, errors }
|
|
191
|
+
return { ok: true, objectives }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Normalises one objective's text for hashing/comparison: trimmed, internal whitespace collapsed to single spaces — an editor's reflow must not move the version. */
|
|
195
|
+
function normalizeText(text: string): string {
|
|
196
|
+
return text.trim().replace(/\s+/g, ' ')
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A stable hash of an objectives list's TEXT — normalised lines, never the
|
|
201
|
+
* rendered markdown, so whitespace an editor reflows does not move the
|
|
202
|
+
* version. Two lists with the same ids and normalised text hash identically;
|
|
203
|
+
* changing one word, or the list itself, changes the hash.
|
|
204
|
+
*/
|
|
205
|
+
export function objectivesVersion(objectives: Objective[]): string {
|
|
206
|
+
const normalized = objectives.map((o) => `${o.id} ${normalizeText(o.text)}`).join('\n')
|
|
207
|
+
return createHash('sha256').update(normalized).digest('hex')
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Renders a `## Objectives` section from a parsed list — the inverse of
|
|
212
|
+
* `objectivesOf`, used by `brief-render.ts` to copy the Issue's list into
|
|
213
|
+
* a brief verbatim.
|
|
214
|
+
*/
|
|
215
|
+
export function renderObjectives(objectives: Objective[]): string {
|
|
216
|
+
return ['## Objectives', '', ...objectives.map((o) => `${o.id}. ${o.text}`)].join('\n')
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Is a `gh issue view` failure just "the Issue number doesn't resolve" — a
|
|
221
|
+
* fixture's placeholder `Closes #NNN`, a deleted Issue — as opposed to a
|
|
222
|
+
* real network/auth/rate-limit failure? Only the first is safe for a
|
|
223
|
+
* caller to treat as "nothing to compare"; the second means the comparison
|
|
224
|
+
* was SKIPPED, not that it passed, and a caller that conflates the two
|
|
225
|
+
* silently stops enforcing whenever enforcement is hardest to verify (a
|
|
226
|
+
* flaky network, an expiring token) — exactly the gap review round 1
|
|
227
|
+
* found independently in both `verify-brief.ts` and `check-brief-shape.ts`
|
|
228
|
+
* (review finding 4). One shared, tested classifier — not a second
|
|
229
|
+
* hand-written copy per caller — is what keeps the two from silently
|
|
230
|
+
* drifting apart on which error strings mean which case (review round 2,
|
|
231
|
+
* MINOR).
|
|
232
|
+
*
|
|
233
|
+
* Pure: takes the already-caught error, never runs `gh` itself — each
|
|
234
|
+
* caller keeps its own tiny `execFileSync` invocation (this module stays
|
|
235
|
+
* `fs`/`fetch`/`process.env`-free, same as every other function here), and
|
|
236
|
+
* passes the resulting error into this one shared decision.
|
|
237
|
+
*
|
|
238
|
+
* Inspects the WHOLE error (message + stderr), since `execFileSync` puts
|
|
239
|
+
* `gh`'s actual GraphQL text on a line that is rarely the first — the same
|
|
240
|
+
* discipline `apps/cli/src/lib/config.ts`'s `isMissingFileError` uses.
|
|
241
|
+
*/
|
|
242
|
+
export function isIssueNotFoundError(err: unknown): boolean {
|
|
243
|
+
const stderr = (err as { stderr?: Buffer | string })?.stderr
|
|
244
|
+
const haystack = [
|
|
245
|
+
(err as Error)?.message ?? '',
|
|
246
|
+
typeof stderr === 'string' ? stderr : (stderr?.toString() ?? '')
|
|
247
|
+
].join('\n')
|
|
248
|
+
return /could not resolve to an (?:issue|pull request)|\b404\b|not found/i.test(haystack)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* WHERE a pull request's objectives come from — before anything is fetched
|
|
253
|
+
* or parsed. `check-review-gate.ts`'s
|
|
254
|
+
* `resolveObjectivesVersion` and `review-post.ts`'s `resolveObjectivesForPr`
|
|
255
|
+
* had each hand-rolled this identical three-way branch — an Issue at/above
|
|
256
|
+
* the cutover wins, then the PR body's own `## Objectives` heading, then
|
|
257
|
+
* neither — with the Issue-vs-cutover branch order kept in sync by hand
|
|
258
|
+
* between the two files (a real history: a missing early pre-cutover
|
|
259
|
+
* return in one of them let a pre-cutover Issue fall through to the body's
|
|
260
|
+
* section). One function, one place the three-way decision is made; both
|
|
261
|
+
* callers switch on its result instead of re-deriving it.
|
|
262
|
+
*
|
|
263
|
+
* Pure and I/O-free by design — it takes the already-extracted Issue number
|
|
264
|
+
* and the PR body text, never fetches either. Fetching the Issue body,
|
|
265
|
+
* parsing it, and turning a parse failure into a refusal are each caller's
|
|
266
|
+
* OWN concern (a check-run emits `emitCheckError`+`process.exit`, the CLI
|
|
267
|
+
* command calls `refuseCmd`) and stay out of this function on purpose: this resolver
|
|
268
|
+
* decides the SOURCE, not what the gate requires once a source exists, and
|
|
269
|
+
* the loop's own principal-gated Issue read
|
|
270
|
+
* substitutes its own fetcher for the `'issue'` case rather than this
|
|
271
|
+
* function reading anything itself.
|
|
272
|
+
*
|
|
273
|
+
* `cutoverIssue` is `OBJECTIVES_SINCE_ISSUE` (`issue-validation.ts`) — passed
|
|
274
|
+
* in, not imported, because `issue-validation.ts` already imports FROM this
|
|
275
|
+
* module (`objectivesOf`); importing the constant back would be circular.
|
|
276
|
+
*/
|
|
277
|
+
export type ObjectivesSource = { kind: 'issue'; issue: number } | { kind: 'body' } | { kind: 'none' }
|
|
278
|
+
|
|
279
|
+
export function resolveObjectivesSource(prBody: string, issue: number | null, cutoverIssue: number): ObjectivesSource {
|
|
280
|
+
// Checked first and unconditionally: a pre-cutover Issue is `'none'`
|
|
281
|
+
// regardless of what the PR body itself carries — a pre-cutover PR must
|
|
282
|
+
// keep passing unchanged, never picking up a body-level objectives list
|
|
283
|
+
// the Issue-linked case was never subject to.
|
|
284
|
+
if (issue !== null && issue < cutoverIssue) return { kind: 'none' }
|
|
285
|
+
if (issue !== null) return { kind: 'issue', issue }
|
|
286
|
+
if (hasObjectivesHeading(prBody)) return { kind: 'body' }
|
|
287
|
+
return { kind: 'none' }
|
|
288
|
+
}
|
|
@@ -4,7 +4,7 @@ import type { LedgerRow } from './types'
|
|
|
4
4
|
import { isPrincipal } from './waiver-label'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Live-source token parsing
|
|
7
|
+
* Live-source token parsing. Where
|
|
8
8
|
* `parse-ledger.ts` reads the Archivist's hand-assembled `<name>.tokens.md`
|
|
9
9
|
* ledger, this file extracts the same `LedgerRow` shape directly from the
|
|
10
10
|
* artifacts says every role already produces on its own turn — the
|
|
@@ -23,14 +23,14 @@ import { isPrincipal } from './waiver-label'
|
|
|
23
23
|
|
|
24
24
|
// A "Token report" heading, alone on its line: `## Token report`,
|
|
25
25
|
// `### Token report`, or the bold-inline `**Token report**` form seen in the
|
|
26
|
-
// wild (real PRs use both
|
|
26
|
+
// wild (real PRs use both forms
|
|
27
27
|
// form). A PR re-pushed after `CHANGES_REQUESTED` carries this heading more
|
|
28
28
|
// than once — every occurrence is parsed as its own entry (roles/developer.md:
|
|
29
29
|
// re-entry appends a new "Token report" entry, never edits the first).
|
|
30
30
|
const TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i
|
|
31
31
|
|
|
32
32
|
// Inline field-list form, a real drift already present in this repo's own
|
|
33
|
-
// history
|
|
33
|
+
// history alongside the table form: one line reading
|
|
34
34
|
// `Phase: … | Role: … | Agent/Model: … | Tokens in: … | Tokens out: … |
|
|
35
35
|
// Cost: … | Date: …`. Tolerated as a second recognized shape rather than
|
|
36
36
|
// treated as malformed, since both are real, current, human-authored output.
|
|
@@ -30,7 +30,7 @@ export function parseTranche(md: string): Tranche {
|
|
|
30
30
|
|
|
31
31
|
function parseName(md: string): string {
|
|
32
32
|
// The H1 is `# Tranche: <slug> — <timeframe>`. The slug may contain
|
|
33
|
-
// hyphens (e.g. `some-tranche-name`, `another-
|
|
33
|
+
// hyphens (e.g. `some-tranche-name`, `another-vN`), so capture the first
|
|
34
34
|
// non-whitespace run — the space before the em-dash is the delimiter.
|
|
35
35
|
//
|
|
36
36
|
// `Iteration:` is accepted as the superseded spelling, permanently. This is
|
|
@@ -3,36 +3,50 @@
|
|
|
3
3
|
* Pure — no `fs`, no `fetch`, no `process.env`.
|
|
4
4
|
*
|
|
5
5
|
* `aeg-root/roles/developer.md` § "PR body — canonical form" and
|
|
6
|
-
* `aeg-root/templates/pr-report-template.md` both require `##
|
|
7
|
-
* `##
|
|
8
|
-
*
|
|
6
|
+
* `aeg-root/templates/pr-report-template.md` both require `## Decisions`
|
|
7
|
+
* (`## Summary` before an earlier rename — see below) and `## Scope`
|
|
8
|
+
* to hold exactly one blank-line-delimited block — narrative root-cause
|
|
9
|
+
* detail belongs in a section of its own below the canonical four, a commit
|
|
9
10
|
* message, or the changeset, never padded into the report itself and never
|
|
10
11
|
* hand-typed into the AEG:EVIDENCE block. Nothing enforced that rule
|
|
11
12
|
* mechanically:
|
|
12
|
-
* confirmed live, three real PRs
|
|
13
|
+
* confirmed live, three real PRs
|
|
13
14
|
* shipped multi-paragraph Summary/Scope sections and nothing caught it,
|
|
14
15
|
* neither at `vinaya pr create`/`pr edit` time nor in CI. Longer, denser
|
|
15
16
|
* prose is also strictly more surface for every other body-text gate
|
|
16
17
|
* (`body-bare-digits`, `reader-resolvable-prose`'s glossary rule) — the same
|
|
17
|
-
* class of gap
|
|
18
|
+
* class of gap a real issue hit in code, just in prose instead.
|
|
19
|
+
*
|
|
20
|
+
* Re-pointed at `## Decisions` (a dogfooding finding): the
|
|
21
|
+
* canonical template renamed `## Summary` to `## Decisions` — a heading this
|
|
22
|
+
* name-matched check cannot see under its old name — and reviewing that
|
|
23
|
+
* same task caught the gap live: a heading rename silently retiring a
|
|
24
|
+
* mechanical check is the same regression class already named
|
|
25
|
+
* for this file, just in the check's own target this time. `Decisions`'
|
|
26
|
+
* shape differs from `Summary`'s (a bullet list, one line per open choice,
|
|
27
|
+
* not a prose paragraph) but the enforced property is unchanged either way:
|
|
28
|
+
* exactly one blank-line-delimited block, so a real bullet list still
|
|
29
|
+
* passes (no blank lines between its own items) while padding it with a
|
|
30
|
+
* second, separately-blocked paragraph of prose still fails.
|
|
18
31
|
*
|
|
19
32
|
* Deterministic and structural only, matching `brief-validation.ts`'s own
|
|
20
33
|
* "presence-only" philosophy: this counts blank-line-delimited text blocks,
|
|
21
34
|
* never judges whether the prose itself is good.
|
|
22
35
|
*
|
|
23
|
-
* The rule is literal — one
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
36
|
+
* The rule is literal — one block, full stop — so a `### subsection` or a
|
|
37
|
+
* markdown table under Decisions/Scope fails too, same as a second
|
|
38
|
+
* blank-line-separated paragraph would (confirmed by probe in review,
|
|
39
|
+
* back when this section was still named `Summary`). That is
|
|
40
|
+
* intentional, not an oversight: `developer.md`'s own escape hatch for
|
|
41
|
+
* exactly this case is "Add anything you want beneath the four sections" —
|
|
42
|
+
* structured detail belongs in a section of its own below
|
|
43
|
+
* Decisions/Scope/Test-plan/Evidence, not folded into one of the four. A
|
|
30
44
|
* multi-line blockquote is the one shape this rule does NOT split on (its
|
|
31
45
|
* `\n>\n` continuation lines are never blank) — but only when the
|
|
32
46
|
* blockquote IS the section, start to finish: prose before or after it is
|
|
33
47
|
* still a separate blank-line-delimited block, so "intro sentence, then a
|
|
34
48
|
* blockquote aside, then a closing sentence" is three blocks and still
|
|
35
|
-
* fails (confirmed by probe
|
|
49
|
+
* fails (confirmed by probe in review — this is not the
|
|
36
50
|
* "structured aside alongside prose" shape it can look like at a glance).
|
|
37
51
|
* The exemption only covers a section whose entire content, quoted in
|
|
38
52
|
* full, is the one thing being said.
|
|
@@ -101,8 +115,8 @@ function checkSectionDensity(prBody: string, heading: string): DensityResult {
|
|
|
101
115
|
}
|
|
102
116
|
}
|
|
103
117
|
|
|
104
|
-
export function
|
|
105
|
-
return checkSectionDensity(prBody, '
|
|
118
|
+
export function checkDecisionsDensity(prBody: string): DensityResult {
|
|
119
|
+
return checkSectionDensity(prBody, 'Decisions')
|
|
106
120
|
}
|
|
107
121
|
|
|
108
122
|
export function checkScopeDensity(prBody: string): DensityResult {
|
|
@@ -111,6 +125,6 @@ export function checkScopeDensity(prBody: string): DensityResult {
|
|
|
111
125
|
|
|
112
126
|
/** Aggregates both section checks — one error line per over-dense section. */
|
|
113
127
|
export function checkPrReportDensity(prBody: string): { errors: string[] } {
|
|
114
|
-
const results = [
|
|
128
|
+
const results = [checkDecisionsDensity(prBody), checkScopeDensity(prBody)]
|
|
115
129
|
return { errors: results.flatMap((r) => r.errors) }
|
|
116
130
|
}
|
|
@@ -63,10 +63,26 @@ export function readTierFromPrBody(prBody: string): 0 | 1 | 3 | null {
|
|
|
63
63
|
return t === 0 || t === 1 || t === 3 ? (t as 0 | 1 | 3) : null
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* The floor-raise combinator: a declared tier is
|
|
68
|
+
* never lowered, only raised to the mechanically-derived floor when that
|
|
69
|
+
* floor is higher — a Planner's judgment is never silently overridden by a
|
|
70
|
+
* derivation that cannot see it. `declared: null` means the source (an
|
|
71
|
+
* Issue, a PR body) declared no `Tier:` field at all, or an invalid one —
|
|
72
|
+
* the derived floor is the only signal, same as before this combinator
|
|
73
|
+
* existed. `derivedFloor` never exceeds `1` (`deriveTierFromDiff`'s own
|
|
74
|
+
* range) — Tier 3 only ever reaches the result by way of `declared`, never
|
|
75
|
+
* by derivation.
|
|
76
|
+
*/
|
|
77
|
+
export function applyTierFloor(declared: 0 | 1 | 3 | null, derivedFloor: 0 | 1): 0 | 1 | 3 {
|
|
78
|
+
if (declared === null) return derivedFloor
|
|
79
|
+
return declared >= derivedFloor ? declared : derivedFloor
|
|
80
|
+
}
|
|
81
|
+
|
|
66
82
|
/**
|
|
67
83
|
* The body token that activates the override — the label name in brackets, so
|
|
68
84
|
* the two spellings cannot drift. Built from the code-owned vocabulary rather
|
|
69
|
-
* than written as a literal
|
|
85
|
+
* than written as a literal: `override:docs` was the one §14 system
|
|
70
86
|
* label the namespace migration missed, precisely because it lived here as a
|
|
71
87
|
* bare string that no label-family grep looked for.
|
|
72
88
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Quoted-command staleness
|
|
2
|
+
* Quoted-command staleness. Pure — no `fs`, no `git`/`gh`.
|
|
3
3
|
*
|
|
4
4
|
* **The defect this closes.** A doc quotes a command, config line, or file
|
|
5
5
|
* content verbatim, in backticks, as a statement of present fact — "what
|