Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a3f4c83
ci: materialize focused review-agent mention router
seonghobae Aug 5, 2026
0cdc975
chore(automation): remove transient mention-router materializer
seonghobae Aug 5, 2026
e8adc56
test(automation): preserve trusted mention-router contracts
seonghobae Aug 5, 2026
39afd62
test(automation): preserve organization mention sweep contracts
seonghobae Aug 5, 2026
57a6b9b
test(automation): preserve least-privilege mention workflow contract
seonghobae Aug 5, 2026
6c5038c
feat(automation): add trusted review-agent mention router
seonghobae Aug 5, 2026
fab2bf9
feat(automation): add bounded organization mention sweep
seonghobae Aug 5, 2026
1867cc8
test(automation): pin mention-router runner and checkout source
seonghobae Aug 5, 2026
8cd9be3
feat(automation): add trusted review-agent mention workflow
seonghobae Aug 5, 2026
7e53010
ci(automation): enforce mention-router quality gates
seonghobae Aug 5, 2026
f6aaa6e
docs(automation): document review-agent mention routing
seonghobae Aug 5, 2026
580909f
docs(changelog): record trusted mention-router slice
seonghobae Aug 5, 2026
b0d2d11
docs(automation): define mention-router activation gate
seonghobae Aug 5, 2026
b67b99e
test(automation): isolate CLI environment contract
seonghobae Aug 5, 2026
95f5e54
test(automation): require path-based coverage measurement
seonghobae Aug 5, 2026
cf4400f
ci(automation): measure exact mention-router script paths
seonghobae Aug 5, 2026
588ea68
test(agent-router): require per-agent durable dispatch idempotency
seonghobae Aug 5, 2026
ee1e33e
test(agent-router): require downstream exact-key idempotency
seonghobae Aug 5, 2026
cb08d05
test(agent-router): separate workflow trigger and pytest contracts
seonghobae Aug 5, 2026
6008bac
test(agent-router): execute durable idempotency contracts
seonghobae Aug 5, 2026
d7c2335
fix(agent-router): deduplicate exact per-agent dispatches
seonghobae Aug 5, 2026
109a5fa
fix(agent-router): accept empty workflow-run inventory
seonghobae Aug 5, 2026
9e11bb3
test(agent-router): model durable run inventory reads
seonghobae Aug 5, 2026
236fd71
fix(agent-router): grant durable workflow-run read access
seonghobae Aug 5, 2026
78af2e0
test(agent-router): require durable dispatch wrappers
seonghobae Aug 5, 2026
f0522c4
feat(agent-router): add durable Noema dispatch wrapper
seonghobae Aug 5, 2026
88b5960
feat(agent-router): add durable OpenCode dispatch wrapper
seonghobae Aug 5, 2026
d4caec6
feat(agent-router): route through durable dispatch wrappers
seonghobae Aug 5, 2026
68877ff
test(agent-router): expect durable wrapper events
seonghobae Aug 5, 2026
ec201df
test(agent-router): cover wrapper event idempotency
seonghobae Aug 5, 2026
c1171d7
test(agent-router): reject unsupported Bash lookahead
seonghobae Aug 5, 2026
316246c
fix(agent-router): use portable Bash base validation
seonghobae Aug 5, 2026
d69a767
ci(agent-router): track durable dispatch wrappers
seonghobae Aug 5, 2026
7a5db21
test(agent-router): make central run ledger authoritative
seonghobae Aug 5, 2026
75df0cd
ci(agent-router): execute receipt authority contract
seonghobae Aug 5, 2026
d3afa23
test(agent-router): make production paths receipt-independent
seonghobae Aug 5, 2026
f384e2e
fix(agent-router): remove local receipt authority
seonghobae Aug 5, 2026
7689c3a
fix(agent-router): make sweep receipt-independent
seonghobae Aug 5, 2026
b86250d
test: prevent no-op sweep requests from exhausting budget
seonghobae Aug 5, 2026
22e4c18
test: assert job permissions independently
seonghobae Aug 5, 2026
1fd0119
test: accept wildcard quality-gate path coverage
seonghobae Aug 5, 2026
9056842
fix: preserve sweep capacity for newly queued work
seonghobae Aug 5, 2026
9427718
test: cover durable run-ledger failure boundaries
seonghobae Aug 5, 2026
ff02c87
docs: record durable dispatch ledger and permission boundary
seonghobae Aug 5, 2026
678be8b
fix(automation): remove branch-selected mention sweep dispatch
seonghobae Aug 6, 2026
c1e28b2
test(automation): prohibit branch-selected mention sweep dispatch
seonghobae Aug 6, 2026
9027938
docs(automation): document protected mention sweep trigger
seonghobae Aug 6, 2026
8aa7101
fix(automation): preserve app-token fallback semantics
seonghobae Aug 6, 2026
e0f2457
test(ci): cover scheduler package import fallback
seonghobae Aug 6, 2026
84bb106
test(automation): require payload-bound agent invocation keys
seonghobae Aug 6, 2026
ef456e3
ci: materialize payload-bound review-agent invocations
seonghobae Aug 6, 2026
af1b35c
ci: add bounded PR 787 payload-binding materializer
seonghobae Aug 6, 2026
b4105d9
ci(pr787): trigger payload-bound invocation repair
seonghobae Aug 6, 2026
b731c29
ci: trigger bounded PR 787 payload-binding repair
seonghobae Aug 6, 2026
521ce30
ci(pr787): stage validated payload-binding repair
seonghobae Aug 6, 2026
eb73298
ci(pr787): run payload-bound repair v2
seonghobae Aug 6, 2026
4427fe1
ci: retrigger verified PR 787 payload-binding repair
seonghobae Aug 6, 2026
550a869
ci(pr787): build verified payload candidate
seonghobae Aug 6, 2026
53c5dc6
ci(pr787): upload verified payload candidate
seonghobae Aug 6, 2026
55152c6
ci(pr787): export verified reviewed files
seonghobae Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/pr787-payload-repair.trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Trigger the exact-head payload-binding repair workflow after the quality gate identified the missing Noema base-branch identity field.
96 changes: 96 additions & 0 deletions .github/workflows/agent-mention-noema-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Agent Mention Noema Dispatch
run-name: >-
Agent Mention Noema ${{ github.event.client_payload.target_repository }}#${{
github.event.client_payload.pr_number }} [cwl-agent-invocation:${{
github.event.client_payload.agent_invocation_key }}]

on:
repository_dispatch:
types: [agent-mention-noema]

concurrency:
group: agent-mention-noema-${{ github.event.client_payload.agent_invocation_key || github.run_id }}
cancel-in-progress: false

permissions:
actions: read
contents: write
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

jobs:
validate-and-forward:
if: github.repository == 'ContextualWisdomLab/.github'
runs-on: ubuntu-24.04
timeout-minutes: 5
env:
GH_TOKEN: ${{ github.token }}
REQUESTED_AGENT: "cwl-noema-review"
PAYLOAD_AGENT: ${{ github.event.client_payload.requested_agent || '' }}
INVOCATION_KEY: ${{ github.event.client_payload.agent_invocation_key || '' }}
TARGET_REPOSITORY: ${{ github.event.client_payload.target_repository || '' }}
PR_NUMBER: ${{ github.event.client_payload.pr_number || '' }}
PR_HEAD_SHA: ${{ github.event.client_payload.pr_head_sha || '' }}
REQUESTED_BY: ${{ github.event.client_payload.requested_by || '' }}
SOURCE_COMMENT_ID: ${{ github.event.client_payload.source_comment_id || '' }}
steps:
- name: Validate exact invocation and elect one durable leader
id: leader
run: |
set -euo pipefail
if [ "$PAYLOAD_AGENT" != "$REQUESTED_AGENT" ] ||
! [[ "$INVOCATION_KEY" =~ ^[0-9a-f]{64}$ ]] ||
! [[ "$TARGET_REPOSITORY" =~ ^ContextualWisdomLab/[A-Za-z0-9_.-]+$ ]] ||
! [[ "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]] ||
! [[ "$PR_HEAD_SHA" =~ ^[0-9a-f]{40}$ ]] ||
! [[ "$SOURCE_COMMENT_ID" =~ ^[1-9][0-9]*$ ]] ||
! [[ "$REQUESTED_BY" =~ ^[A-Za-z0-9-]+$ ]]; then
echo "::error::Rejected malformed or mismatched Noema agent invocation payload."
exit 1
fi

marker="[cwl-agent-invocation:${INVOCATION_KEY}]"
leader_id="$(
gh api --paginate --slurp \
"repos/${GITHUB_REPOSITORY}/actions/workflows/agent-mention-noema-dispatch.yml/runs?event=repository_dispatch&per_page=100" \
| jq -r --arg marker "$marker" '
[.[].workflow_runs[]
| select((.display_title // "") | contains($marker))
| .id]
| min // empty
'
)"
if [ -z "$leader_id" ]; then
echo "::error::Could not establish the durable Noema invocation leader."
exit 1
fi
if [ "$leader_id" != "$GITHUB_RUN_ID" ]; then
echo "forward=false" >>"$GITHUB_OUTPUT"
echo "Duplicate exact-key invocation suppressed by durable workflow-run identity."
exit 0
fi
echo "forward=true" >>"$GITHUB_OUTPUT"

- name: Forward once to the authoritative Noema workflow
if: steps.leader.outputs.forward == 'true'
run: |
set -euo pipefail
jq -n \
--arg target_repository "$TARGET_REPOSITORY" \
--argjson pr_number "$PR_NUMBER" \
--arg pr_head_sha "$PR_HEAD_SHA" \
--arg requested_agent "$REQUESTED_AGENT" \
--arg agent_invocation_key "$INVOCATION_KEY" \
--arg requested_by "$REQUESTED_BY" \
--argjson source_comment_id "$SOURCE_COMMENT_ID" \
'{
event_type: "noema-review",
client_payload: {
target_repository: $target_repository,
pr_number: $pr_number,
pr_head_sha: $pr_head_sha,
requested_agent: $requested_agent,
agent_invocation_key: $agent_invocation_key,
requested_by: $requested_by,
source_comment_id: $source_comment_id
}
}' \
| gh api "repos/${GITHUB_REPOSITORY}/dispatches" -X POST --input -
116 changes: 116 additions & 0 deletions .github/workflows/agent-mention-opencode-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Agent Mention OpenCode Dispatch
run-name: >-
Agent Mention OpenCode ${{ github.event.client_payload.target_repository }}#${{
github.event.client_payload.pr_number }} [cwl-agent-invocation:${{
github.event.client_payload.agent_invocation_key }}]

on:
repository_dispatch:
types: [agent-mention-opencode]

concurrency:
group: agent-mention-opencode-${{ github.event.client_payload.agent_invocation_key || github.run_id }}
cancel-in-progress: false

permissions:
actions: read
contents: write
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

jobs:
validate-and-forward:
if: github.repository == 'ContextualWisdomLab/.github'
runs-on: ubuntu-24.04
timeout-minutes: 5
env:
GH_TOKEN: ${{ github.token }}
REQUESTED_AGENT: "opencode-agent"
PAYLOAD_AGENT: ${{ github.event.client_payload.requested_agent || '' }}
INVOCATION_KEY: ${{ github.event.client_payload.agent_invocation_key || '' }}
TARGET_REPOSITORY: ${{ github.event.client_payload.target_repository || '' }}
PR_NUMBER: ${{ github.event.client_payload.pr_number || '' }}
PR_HEAD_SHA: ${{ github.event.client_payload.pr_head_sha || '' }}
BASE_BRANCH: ${{ github.event.client_payload.base_branch || '' }}
REQUESTED_BY: ${{ github.event.client_payload.requested_by || '' }}
SOURCE_COMMENT_ID: ${{ github.event.client_payload.source_comment_id || '' }}
TRIGGER_REVIEWS: ${{ github.event.client_payload.trigger_reviews }}
REVIEW_DISPATCH_LIMIT: ${{ github.event.client_payload.review_dispatch_limit || '' }}
ENABLE_AUTO_MERGE: ${{ github.event.client_payload.enable_auto_merge }}
UPDATE_BRANCHES: ${{ github.event.client_payload.update_branches }}
MERGE_MODE: ${{ github.event.client_payload.merge_mode || '' }}
steps:
- name: Validate exact review-only invocation and elect one durable leader
id: leader
run: |
set -euo pipefail
if [ "$PAYLOAD_AGENT" != "$REQUESTED_AGENT" ] ||
! [[ "$INVOCATION_KEY" =~ ^[0-9a-f]{64}$ ]] ||
! [[ "$TARGET_REPOSITORY" =~ ^ContextualWisdomLab/[A-Za-z0-9_.-]+$ ]] ||
! [[ "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]] ||
! [[ "$PR_HEAD_SHA" =~ ^[0-9a-f]{40}$ ]] ||
! [[ "$BASE_BRANCH" =~ ^[A-Za-z0-9._/-]+$ ]] ||
[[ "$BASE_BRANCH" == -* ]] ||
! [[ "$SOURCE_COMMENT_ID" =~ ^[1-9][0-9]*$ ]] ||
! [[ "$REQUESTED_BY" =~ ^[A-Za-z0-9-]+$ ]] ||
[ "$TRIGGER_REVIEWS" != "true" ] ||
[ "$REVIEW_DISPATCH_LIMIT" != "1" ] ||
[ "$ENABLE_AUTO_MERGE" != "false" ] ||
[ "$UPDATE_BRANCHES" != "false" ] ||
[ "$MERGE_MODE" != "disabled" ]; then
echo "::error::Rejected malformed, mismatched, or mutation-capable OpenCode invocation payload."
exit 1
fi

marker="[cwl-agent-invocation:${INVOCATION_KEY}]"
leader_id="$(
gh api --paginate --slurp \
"repos/${GITHUB_REPOSITORY}/actions/workflows/agent-mention-opencode-dispatch.yml/runs?event=repository_dispatch&per_page=100" \
| jq -r --arg marker "$marker" '
[.[].workflow_runs[]
| select((.display_title // "") | contains($marker))
| .id]
| min // empty
'
)"
if [ -z "$leader_id" ]; then
echo "::error::Could not establish the durable OpenCode invocation leader."
exit 1
fi
if [ "$leader_id" != "$GITHUB_RUN_ID" ]; then
echo "forward=false" >>"$GITHUB_OUTPUT"
echo "Duplicate exact-key invocation suppressed by durable workflow-run identity."
exit 0
fi
echo "forward=true" >>"$GITHUB_OUTPUT"

- name: Forward once to the authoritative review-only scheduler
if: steps.leader.outputs.forward == 'true'
run: |
set -euo pipefail
jq -n \
--arg target_repository "$TARGET_REPOSITORY" \
--argjson pr_number "$PR_NUMBER" \
--arg pr_head_sha "$PR_HEAD_SHA" \
--arg base_branch "$BASE_BRANCH" \
--arg requested_agent "$REQUESTED_AGENT" \
--arg agent_invocation_key "$INVOCATION_KEY" \
--arg requested_by "$REQUESTED_BY" \
--argjson source_comment_id "$SOURCE_COMMENT_ID" \
'{
event_type: "merge-scheduler",
client_payload: {
target_repository: $target_repository,
pr_number: $pr_number,
pr_head_sha: $pr_head_sha,
base_branch: $base_branch,
trigger_reviews: true,
review_dispatch_limit: "1",
enable_auto_merge: false,
update_branches: false,
merge_mode: "disabled",
requested_agent: $requested_agent,
agent_invocation_key: $agent_invocation_key,
requested_by: $requested_by,
source_comment_id: $source_comment_id
}
}' \
| gh api "repos/${GITHUB_REPOSITORY}/dispatches" -X POST --input -
96 changes: 96 additions & 0 deletions .github/workflows/agent-mention-router-quality-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Agent Mention Router Quality CI

on:
pull_request:
branches: [main]
paths:
- ".github/workflows/agent-mention-router.yml"
- ".github/workflows/agent-mention-router-quality-ci.yml"
- ".github/workflows/agent-mention-noema-dispatch.yml"
- ".github/workflows/agent-mention-opencode-dispatch.yml"
- "scripts/ci/agent_mention_router.py"
- "scripts/ci/agent_mention_sweep.py"
- "tests/test_agent_mention_*.py"
- "requirements-opencode-review-ci-hashes.txt"
push:
branches: [main]
paths:
- ".github/workflows/agent-mention-router.yml"
- ".github/workflows/agent-mention-router-quality-ci.yml"
- ".github/workflows/agent-mention-noema-dispatch.yml"
- ".github/workflows/agent-mention-opencode-dispatch.yml"
- "scripts/ci/agent_mention_router.py"
- "scripts/ci/agent_mention_sweep.py"
- "tests/test_agent_mention_*.py"
- "requirements-opencode-review-ci-hashes.txt"

concurrency:
group: agent-mention-router-quality-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
quality:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Harden runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Checkout exact head
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: pip
cache-dependency-path: requirements-opencode-review-ci-hashes.txt
- name: Install exact hash-locked tooling
run: >-
python -m pip install --disable-pip-version-check --require-hashes
-r requirements-opencode-review-ci-hashes.txt
- name: Run complete focused branch coverage
shell: bash --noprofile --norc -e -o pipefail {0}
run: |
cat >"${RUNNER_TEMP}/agent-mention-coveragerc" <<'EOF'
[run]
branch = True
include =
scripts/ci/agent_mention_router.py
scripts/ci/agent_mention_sweep.py
[report]
fail_under = 100
show_missing = True
EOF
export COVERAGE_RCFILE="${RUNNER_TEMP}/agent-mention-coveragerc"
python -m coverage erase
python -m coverage run -m pytest -q \
tests/test_agent_mention_router.py \
tests/test_agent_mention_sweep.py \
tests/test_agent_mention_workflow_contract.py \
tests/test_agent_mention_idempotency.py \
tests/test_agent_mention_downstream_idempotency.py \
tests/test_agent_mention_receipt_authority.py
python -m coverage report --fail-under=100
python -m interrogate --fail-under=100 \
scripts/ci/agent_mention_router.py \
scripts/ci/agent_mention_sweep.py
python -m compileall -q \
scripts/ci/agent_mention_router.py \
scripts/ci/agent_mention_sweep.py \
tests/test_agent_mention_router.py \
tests/test_agent_mention_sweep.py \
tests/test_agent_mention_workflow_contract.py \
tests/test_agent_mention_idempotency.py \
tests/test_agent_mention_downstream_idempotency.py \
tests/test_agent_mention_receipt_authority.py
git diff --check
Loading
Loading