Skip to content

feat: implement issue #1406 — [Phase 3] Add scripts/validate-interaction-model.sh + bats, wired into lint.yml as a PR-triggered check - #1505

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-1406-20260812-1909
Aug 12, 2026
Merged

feat: implement issue #1406 — [Phase 3] Add scripts/validate-interaction-model.sh + bats, wired into lint.yml as a PR-triggered check#1505
don-petry merged 3 commits into
mainfrom
dev-lead/issue-1406-20260812-1909

Conversation

@don-petry

@don-petry don-petry commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

User description

Closes #1406

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Enforce agent interaction rules in pull request checks

What Changed

  • Added a hermetic validator that checks workflow classifications, schedules, interaction contracts, retry safety, concurrency lanes, and event-boundary rules.
  • Reports all detected violations, including missing or stale workflow classifications, invalid timer roles, contract mismatches, and unsafe agent-to-agent event chains.
  • Added fixture-based tests covering valid configurations, each violation type, combined failures, misclassification, and stale table entries.
  • Wired the validator and its tests into the existing lint workflow as a pull-request check.

Impact

✅ Unsafe agent workflow changes blocked before merge
✅ Fewer runaway or duplicate agent interactions
✅ Clearer pull request failures for interaction-model drift

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…ion-model.sh + bats, wired into lint.yml as a PR-triggered check
@don-petry
don-petry requested a review from a team as a code owner August 12, 2026 19:34
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 13d31cb Aug 12, 2026 · 19:34 19:37

@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 seconds

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2cc076e7-34b0-40bf-8ece-60751f586e75

📥 Commits

Reviewing files that changed from the base of the PR and between 8c032d1 and 7f9c868.

📒 Files selected for processing (65)
  • .github/workflows/lint.yml
  • scripts/validate-interaction-model.sh
  • tests/fixtures/interaction-model/combined/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/combined/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/combined/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/combined/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/combined/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/combined/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/fail-a/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/fail-a/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/fail-a/.github/workflows/gamma.yml
  • tests/fixtures/interaction-model/fail-a/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/fail-a/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/fail-a/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/fail-a/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/fail-b/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/fail-b/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/fail-b/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/fail-b/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/fail-b/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/fail-b/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/fail-c/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/fail-c/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/fail-c/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/fail-c/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/fail-c/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/fail-c/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/fail-d/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/fail-d/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/fail-d/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/fail-d/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/fail-d/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/fail-d/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/fail-e/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/fail-e/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/fail-e/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/fail-e/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/fail-e/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/fail-e/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/misclass-1as3/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/misclass-1as3/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/misclass-1as3/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/misclass-1as3/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/misclass-1as3/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/misclass-1as3/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/misclass-3as1/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/misclass-3as1/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/misclass-3as1/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/misclass-3as1/.github/workflows/report.yml
  • tests/fixtures/interaction-model/misclass-3as1/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/misclass-3as1/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/misclass-3as1/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/pass/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/pass/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/pass/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/pass/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/pass/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/pass/personas/alpha/interaction.yml
  • tests/fixtures/interaction-model/table-dangling/.github/workflows/alpha.yml
  • tests/fixtures/interaction-model/table-dangling/.github/workflows/beta.yml
  • tests/fixtures/interaction-model/table-dangling/.github/workflows/plumbing.yml
  • tests/fixtures/interaction-model/table-dangling/docs/agentic-interaction-model.md
  • tests/fixtures/interaction-model/table-dangling/interaction-contracts/beta.yml
  • tests/fixtures/interaction-model/table-dangling/personas/alpha/interaction.yml
  • tests/test_validate_interaction_model.bats

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Aug 12, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 19:35

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new validation script scripts/validate-interaction-model.sh along with comprehensive BATS unit tests and fixtures to mechanically enforce the agentic interaction model. The review feedback highlights several improvement opportunities: refactoring imv_v_boundary to accumulate subscription pairs in a local variable instead of using temporary files to prevent orphaned files and subshells; enhancing YAML inline array and repository_dispatch parsing to robustly handle single-quoted strings; and tightening BATS test assertions to check for an exit status of exactly 1 instead of -ne 0 when verifying that a pattern is not found.

Comment thread scripts/validate-interaction-model.sh
Comment thread scripts/validate-interaction-model.sh Outdated
Comment thread scripts/validate-interaction-model.sh Outdated
Comment thread tests/test_validate_interaction_model.bats Outdated
@don-petry
don-petry disabled auto-merge August 12, 2026 19:37
Comment thread scripts/validate-interaction-model.sh Outdated
Comment thread scripts/validate-interaction-model.sh
donpetry-bot
donpetry-bot previously approved these changes Aug 12, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 13d31cb10bb6e27c9df342827a3d173b9fff2ede
Review mode: triage-approved (single reviewer)

Summary

Confirms the triage assessment: this PR implements issue #1406 (Phase 3 interaction-model validator) completely and safely. Adds a hermetic 439-line bash validator (scripts/validate-interaction-model.sh) with seven tagged violation classes, a 224-line bats suite (unit tests per helper + one isolated fixture tree per violation class + combined-violation + both misclassification directions + dangling-table + live-tree pass), and one PR-triggered job in lint.yml with no new cron. Of the 65 changed files, 62 are test fixtures. All 8 acceptance criteria (including the 3 QA-Lead additions) are satisfied.

Linked issue analysis

Closes #1406. AC1 (a–e detectors): implemented as imv_v_completeness, imv_v_timer_roles, imv_v_contracts (events+crons mirror, idempotency_key/concurrency_lane), and imv_v_boundary — each with a fault-seeded fixture. AC2: bats suite mirrors test_validate_workflow_schedules.bats with per-class regression fixtures. AC3: validate-interaction-model job added to lint.yml, PR-triggered, no schedule.cron; bats file registered in the run-bats.sh list. AC4: FAIL[a] fires on any in-scope workflow without a §4 row (proven by fail-a/gamma.yml fixture). AC5: hermetic — reads in-repo files only, INTERACTION_MODEL_ROOT override mirrors validate-workflow-schedules.sh. AC6: combined fixture asserts both FAIL[b] and FAIL[c] are reported (no first-failure short-circuit; main accumulates all detector output before failing). AC7: both misclassification directions covered (misclass-1as3, misclass-3as1) via the §3 schedule discriminator. AC8: §4 table cross-checked against real on: blocks, incl. FAIL[table] for dangling rows and bidirectional completeness. A final live-tree test pins that the current repo passes.

Findings

No blocking findings.

  • Security: new lint.yml job runs under the workflow-level permissions: contents: read; checkout is SHA-pinned to 3d3c42e5aac5ba805825da76410c181273ba90b1 — verified via the GitHub API as the authentic actions/checkout v7.0.1 tag — with persist-credentials: false. The validator is hermetic (no network, no gh, no secrets). The run_secret_scanning MCP tool was not available in this run; the gitleaks CI check passed.
  • Unresolved bot threads (4, gemini-code-assist, 3×medium 1×low — assessed non-blocking): (1) mktemp/rm in imv_v_boundary could leak a temp file on premature exit — cosmetic on ephemeral CI runners; (2)+(3) inline-array parsing strips double quotes but not single quotes — a single-quoted on: ['push'] would fail LOUD (contract-mismatch FAIL[c]) rather than silently pass, and on: [schedule] is invalid GitHub Actions syntax so no silent schedule miss is possible; (4) bats grep assertions use -ne 0 instead of -eq 1 — style. The dev-lead agent reviewed these and posted an explicit review-changes (no-changes) verdict. No human-reviewer questions are pending.
  • Minor (non-blocking): the new job pins actions/checkout v7.0.1 while the rest of lint.yml uses v6.0.3 — a version-consistency nit for a future housekeeping pass; reusable-pin-compliance passed.

CI status

All completed checks green: Lint, shellcheck/ShellCheck, actionlint, bats, unit-tests, CodeQL (actions+python), Agent Security Scan, agent-shield, Secret scan (gitleaks), SonarCloud quality gate, validate-interaction-model, validate-workflow-schedules, caller-stub-freeze, holdout-guard, and all other stub/permission/persona checks. The only non-completed entries are this review lane itself (pr-auto-review / review / dev-lead dispatch).


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 12, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 19:42
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 12, 2026
@don-petry
don-petry disabled auto-merge August 12, 2026 19:42
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #1505
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-12T20:21:56Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-08-12T20:21:56Z

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 19:52
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-08-12T20:53:17Z.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 7f9c86821868e7e69e5fc0f89e461967607dd945
Review mode: triage-approved (single reviewer)

Summary

Confirms the triage assessment and re-approves at the new head. This PR implements issue #1406 (Phase 3 interaction-model validator): a hermetic 456-line bash validator (scripts/validate-interaction-model.sh, seven tagged violation classes, reports all violations without short-circuiting), a 244-line bats suite (unit tests per helper, one isolated fault-seeded fixture tree per violation class, combined-violation, both misclassification directions, dangling-table row, and a live-tree pass test), and one PR-triggered job in lint.yml with no new cron. Of 65 changed files, 62 are minimal test fixtures. Since the prior (dismissed) approval at 13d31cb, two fix-reviews commits addressed all bot review threads — imv_v_boundary now accumulates subscriptions in a shell variable instead of mktemp/rm, single quotes are stripped alongside double quotes in the awk parsers, and repository_dispatch block-form types: lists and bare unfiltered repository_dispatch: triggers are now parsed — each pinned by new bats tests. All 6 review threads are resolved and no new issues were introduced.

Linked issue analysis

Closes #1406; all 8 acceptance criteria (incl. the 3 QA-Lead additions) are satisfied. AC1a–e: detectors imv_v_completeness (FAIL[a]), imv_v_timer_roles (FAIL[b]), imv_v_contracts (FAIL[c] events/crons mirror + FAIL[d] idempotency_key/concurrency_lane), imv_v_boundary (FAIL[e] suppressed-event chain without a repository_dispatch bridge). AC2: per-class regression fixture trees under tests/fixtures/interaction-model/. AC3: validate-interaction-model job in lint.yml, PR-triggered, no schedule.cron, bats file registered in the run-bats list. AC4: FAIL[a] fires for any in-scope workflow lacking a §4 row (fail-a/gamma.yml). AC5: hermetic — in-repo reads only, INTERACTION_MODEL_ROOT override mirrors validate-workflow-schedules.sh. AC6: combined fixture asserts both FAIL[b] and FAIL[c] are reported. AC7: both misclassification directions (misclass-1as3, misclass-3as1). AC8: §4 table cross-checked against real on: blocks, incl. FAIL[table] for dangling rows; a final test pins that the live repo tree passes.

Findings

No blocking findings.

  • Incremental check (13d31cb7f9c868): only scripts/validate-interaction-model.sh (+28/−11) and tests/test_validate_interaction_model.bats (+21/−1) changed, exactly matching the resolved review threads (gemini: mktemp/rm removal, single-quote stripping, grep-assertion style; graphite: repository_dispatch block-form and bare-trigger parsing). All prior findings resolved; no new issues introduced.
  • Security: the new lint.yml job runs under the workflow-level permissions: contents: read; checkout is SHA-pinned to 3d3c42e5aac5ba805825da76410c181273ba90b1, re-verified via the GitHub API this run as the authentic actions/checkout v7.0.1 tag, with persist-credentials: false. The validator is hermetic (no network, no gh, no credentials). The run_secret_scanning MCP tool was not available in this run; the gitleaks CI check passed and the diff adds no secrets (fixtures and shell only).
  • Prior rate-limit withhold at this same SHA (reset 2026-08-12T20:53:17Z): superseded by this full pass. Advisory coverage is materially present — gemini-code-assist reviewed substantively and its findings are fixed and test-pinned, SonarCloud quality gate passed with 0 new issues, and the CodeRabbit and Graphite AI checks report SUCCESS. The remaining blocked bots (Qodo billing-blocked, Codex usage-limited) are not recoverable by waiting out the rate-limit window.
  • Minor (non-blocking, carried from prior review): the new job pins actions/checkout v7.0.1 while the rest of lint.yml uses an older pin — a version-consistency nit for a future housekeeping pass; reusable-pin-compliance passed.
  • No unresolved review threads (6/6 resolved) and no unanswered human-reviewer questions.

CI status

All completed checks green at 7f9c868: Lint, shellcheck/ShellCheck, actionlint, bats, unit/unit-tests, CodeQL (actions + python), Agent Security Scan, agent-shield, Secret scan (gitleaks), SonarCloud quality gate, validate-fixtures, validate-interaction-contracts, validate-interaction-model, validate-workflow-schedules, caller-stub-freeze and all other stub/permission/persona checks, prompt-coverage, holdout-guard. The two CANCELLED review/review entries are superseded prior runs of this review lane itself; dependabot/audit skips are expected.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit a6a1598 into main Aug 12, 2026
56 of 58 checks passed
@don-petry
don-petry deleted the dev-lead/issue-1406-20260812-1909 branch August 12, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 3] Add scripts/validate-interaction-model.sh + bats, wired into lint.yml as a PR-triggered check

2 participants