feat(cli): lint ADR-0044 approval revise-loop footguns at compile time#2279
Merged
Conversation
`objectstack compile` (lint-flow-patterns) now warns on two send-back-for- revision shapes an AI authoring an approval flow gets wrong: - Dead-end revise: an approval with a `revise` out-edge but no path looping back to it — a valid DAG that `registerFlow` ACCEPTS, yet the submitter reworks the record with nowhere to resubmit. The linter is the only place that catches this. - Un-declared revise loop: the loop returns to the approval but the closing edge isn't `type: 'back'`, so `registerFlow` rejects it as an un-declared cycle — the lint fires at compile time with the specific fix. Also flags `maxRevisions: 0` alongside a `revise` edge (send-back disabled). Advisory only; never fails the build. Mirrors the client-side rule shipped in objectui (#1958). Refs #2274, #1770 (ADR-0044). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
added a commit
that referenced
this pull request
Jun 24, 2026
… on main) (#2283) `packages/cli/src/utils/lint-flow-patterns.test.ts:190` had an untyped `edges` parameter (TS7006 under the build's noImplicitAny), introduced by #2279. The TypeScript Type Check job builds the whole workspace, so this fails CI for *every* open PR. Add the edge-array type (and an explicit approvalConfig type). Test-only; no behavior change. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 24, 2026
os-zhuang
added a commit
that referenced
this pull request
Jun 24, 2026
…vision shape (#2294) The objectstack-automation skill documented approve/reject approvals (ADR-0019) but not the ADR-0044 revise loop, so AI-authored approval flows omit it (and a revise loop hand-built without the back-edge gets rejected by registerFlow). Add a "Send-back for revision" section to the Approvals area: the `revise` out-edge → a signal `wait` node, the resubmit edge typed `type: 'back'` (the only thing that legalizes the cycle — graph-minus-back-edges must be a DAG, authors opt in edge by edge), and the `maxRevisions` budget. Calls out the two shapes the compile-time flow lint flags (dead-end revise; unmarked back-edge) and points at the canonical showcase_budget_approval. Completes the agent-teaching slice of #2274 (ADR-0044), alongside the compile-time lint (#2279), the flow-builder `back` edge style (#2291), and the engine's already-specific cycle-rejection hint. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 24, 2026
os-zhuang
added a commit
that referenced
this pull request
Jun 24, 2026
) Adds skills/objectstack-automation/evals/approvals/test-revise-loop.md, the first concrete eval under the skills' (previously placeholder) evals/ format — Scenario / Expected Output / Common Mistakes / Validation Criteria. It pins the expected send-back-for-revision shape (revise branch + signal wait + type:'back' resubmit + maxRevisions), the three footguns the compile-time lint flags, and registerFlow- based pass criteria. This is the authorable (a) half of #2274's eval slice. The executable eval RUNNER (b) remains a separate platform project — the skills' evals/ harness is still "not yet implemented" per each dir's README. Refs #2274, #1770 (ADR-0044). Builds on the lint (#2279) and skill (#2294). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
First slice of #2274 (AI Build-mode awareness of the ADR-0044 revise loop).
objectstack compile's flow anti-pattern linter (lint-flow-patterns.ts) — whose stated job is to "guide the author, very often an AI generating templates, toward the robust pattern" — now catches the two send-back-for-revision shapes an approval flow most commonly gets wrong:reviseout-edge but no path loops back to it. This is a valid DAG, soregisterFlowaccepts it — yet the submitter reworks the record with nowhere to resubmit. The linter is the only place that catches this footgun.type: 'back', soregisterFlowrejects it as an un-declared cycle. The lint fires at compile time with the specific fix ("mark the resubmit edgetype: 'back'"), so the author/agent corrects it before registration.maxRevisions: 0+ areviseedge — self-contradictory (send-back disabled → the branch always auto-rejects); flagged too.Advisory warnings only — never fails the build (consistent with the existing #1874 rules). This mirrors, server-side, the client-side cycle surfacing shipped in objectui (#1958).
Scope
This is the deterministic guardrail piece of #2274 (compile-time structured feedback). The remaining #2274 work — agent prompt/few-shot,
flow-builder.zod.tsbackedge style, and an eval, plus the optional auto-repair — stays tracked on #2274.Files
packages/cli/src/utils/lint-flow-patterns.ts—scanApprovalReviseLoops()+ 3 rule ids (flow-approval-revise-dead-end,-unmarked-backedge,-disabled).packages/cli/src/utils/lint-flow-patterns.test.ts— 5 new cases.Verification
@objectstack/clitests: 28 passing (5 new — declared loop accepted; unmarked loop flagged; dead-end flagged;maxRevisions:0flagged; normal approval not flagged).tsc -p tsconfig.build.jsonclean for the changed files;eslintclean.Refs #2274, #1770 (ADR-0044). Pairs with objectui #1954 / #1955 / #1958.
🤖 Generated with Claude Code