Skip to content
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
71 changes: 66 additions & 5 deletions .github/workflows/agent-continuous-ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ name: Continuous agent ops

on:
schedule:
# Every 2 hours — enough to clear lag without burning review quota
- cron: '17 */2 * * *'
# Every hour — enough to clear lag without burning review quota
- cron: '17 * * * *'
workflow_dispatch:
inputs:
force_all:
Expand All @@ -34,10 +34,20 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
contents: write
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
pull-requests: write
issues: write
steps:
- name: Checkout monorepo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Comment on lines +42 to +49

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

🔍 Sweep job now runs with contents: write and a checkout

The job permission was widened from contents: read to contents: write and a repo checkout was added so the generated index can be pushed. This means the untrusted-ish github-script sweep step now executes with a token that can write to the default branch. Worth confirming this elevation is intended and that no step in the job consumes PR-controlled content (PR bodies/comments are read into the script but only used for filtering/markers).

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


- name: Calculate Response Time Lag Index
env:
OPERATOR_GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN || secrets.OPERATOR_TOKEN || secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
python3 scripts/ci/calculate_lag_index.py
Comment on lines +51 to +56

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

📝 Info: Lag calculation step is unguarded and can abort the whole sweep

python3 scripts/ci/calculate_lag_index.py runs before the sweep step with no continue-on-error. Individual API calls are wrapped, but any unexpected failure (e.g. a PR payload without the expected keys at scripts/ci/calculate_lag_index.py:103-105, or a filesystem error) will fail the job before any PR is nudged, silently disabling the continuous-ops sweep. Since the sweep already has full default fallbacks when the index file is missing, marking this step continue-on-error: true would make the degradation graceful.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


- name: Sweep open PRs and advance stuck work
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
env:
Expand All @@ -51,8 +61,22 @@ jobs:
const forceAll = process.env.FORCE_ALL === 'true';
const maxPrs = Math.min(Number(process.env.MAX_PRS) || 8, 20);
const marker = '<!-- continuous-agent-ops -->';
const debounceMs = 90 * 60 * 1000; // 90 minutes
const staleMs = 3 * 60 * 60 * 1000; // 3 hours without agent activity

// Default fallbacks
const defaultDebounceMs = 90 * 60 * 1000; // 90 minutes
const defaultStaleMs = 3 * 60 * 60 * 1000; // 3 hours without agent activity

// Load dynamic lag index if available
const fs = require('fs');
let lagIndex = {};
try {
if (fs.existsSync('docs/ops/response_time_lag_index.json')) {
lagIndex = JSON.parse(fs.readFileSync('docs/ops/response_time_lag_index.json', 'utf8'));
core.info('Successfully loaded dynamic response time lag index.');
}
} catch (e) {
core.info('Could not load lag index, using default fallbacks: ' + e.message);
}

const agentLogins = [
'google-labs-jules', 'devin-ai-integration', 'coderabbitai',
Expand Down Expand Up @@ -105,6 +129,29 @@ jobs:
per_page: 100,
});

// Get dynamic debounce and stale times
let debounceMs = defaultDebounceMs;
let staleMs = defaultStaleMs;

if (lagIndex.by_pr && lagIndex.by_pr[String(pr.number)]) {
const metrics = lagIndex.by_pr[String(pr.number)];
if (metrics.suggested_debounce_ms) {
debounceMs = metrics.suggested_debounce_ms;
}
if (metrics.suggested_stale_ms) {
staleMs = metrics.suggested_stale_ms;
}
} else if (lagIndex.global_averages) {
if (lagIndex.global_averages.suggested_debounce_ms) {
debounceMs = lagIndex.global_averages.suggested_debounce_ms;
}
if (lagIndex.global_averages.suggested_stale_ms) {
staleMs = lagIndex.global_averages.suggested_stale_ms;
}
}
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved

core.info(`PR #${pr.number}: Using debounceMs=${debounceMs} (${Math.round(debounceMs/60000)}m), staleMs=${staleMs} (${Math.round(staleMs/3600000)}h)`);
Comment on lines +146 to +167

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

🔍 Dynamic thresholds can shorten debounce/stale windows and increase nudge frequency

The dynamic values loaded here come from scripts/ci/calculate_lag_index.py, which floors them at 30 minutes (debounce) and 60 minutes (stale) — scripts/ci/calculate_lag_index.py:188-189 and :206-210. Combined with the cron change from every 2 hours to hourly (.github/workflows/agent-continuous-ops.yml:13-14), a repo with fast-responding bots will end up with a 30-minute debounce and a 1-hour stale threshold instead of the previous 90m/3h. That triples the potential nudge rate on PRs with open threads, which is the opposite of the stated "without burning review quota" goal. Worth confirming the floors are the intended lower bounds.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +146 to +167

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.

📝 Info: Per-PR debounce/stale values are unbounded from the JSON index

suggested_debounce_ms / suggested_stale_ms read from docs/ops/response_time_lag_index.json are applied with no upper clamp. Because scripts/ci/calculate_lag_index.py derives them as 1.5× observed lag, a single long-idle PR (e.g. a summon answered days later) can push the suggested windows to days, effectively silencing the sweep for that PR. Consider clamping to a sane maximum (e.g. the sticky 6h window) when consuming the index.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


const lastOps = comments
.filter(c => c.body && c.body.includes(marker))
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at))[0];
Expand Down Expand Up @@ -217,3 +264,17 @@ jobs:
.write();

core.setOutput('acted', String(acted));

- name: Commit and Push Updated Lag Index & SSOT
env:
GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN || secrets.OPERATOR_TOKEN || secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add docs/ops/response_time_lag_index.json docs/ops/LANE_CONSOLIDATION_SSOT.md
if ! git diff-index --quiet HEAD --; then
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
git commit -m "docs: dynamic update of lane consolidation lag index & SSOT"
git push origin HEAD:${{ github.ref }} || echo "Could not push changes; skipping (likely read-only token or PR branch)"
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment on lines +381 to +384

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

🟡 Scheduled job commits documentation straight to the default branch instead of the staging branch

Generated documentation is committed and pushed to whatever branch the schedule runs on (git push origin HEAD:${{ github.ref }} at .github/workflows/agent-continuous-ops.yml:277), which for the hourly cron is the default branch, bypassing the repository's staging-branch and gate requirements.
Impact: Automated content lands on the main branch every hour without passing the required review gates.

Rule and mechanism

AGENTS.md states as a hard rule: "Target master-staging, not raw master, for integration work" and "Both gates must pass before merge". The scheduled trigger (.github/workflows/agent-continuous-ops.yml:12-14) runs on the default branch, so github.ref resolves to refs/heads/master, and the checkout + push sequence (.github/workflows/agent-continuous-ops.yml:41-42, 274-277) writes generated files there directly with contents: write (.github/workflows/agent-continuous-ops.yml:37). Consider pushing to master-staging (or opening a PR) instead.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +375 to +384

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

🟡 Privileged token configured for the push step is never actually used

The elevated credential is only exported as an environment variable (GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN || ... }} at .github/workflows/agent-continuous-ops.yml:269-270) while the push reuses the credentials stored during checkout, so the update is always attempted with the default, lower-privileged identity.
Impact: On branches that require an operator identity, the hourly update silently fails to publish and the failure is swallowed.

Why the env var has no effect

actions/checkout (.github/workflows/agent-continuous-ops.yml:41-42) persists the default GITHUB_TOKEN into the remote URL's extraheader. A plain git push (.github/workflows/agent-continuous-ops.yml:277) uses that stored credential; setting a GITHUB_TOKEN env var does not change git auth. Additionally the push error is swallowed by || echo ..., so nothing surfaces when it is rejected (e.g. by branch protection on the default branch).

To actually use the operator token, pass it to actions/checkout via with: token: or set an explicit authenticated remote URL.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

else
echo "No changes to lag index/SSOT."
fi
Comment on lines +375 to +387

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

🔍 Lag-index push step relies on checkout-persisted credentials, not the env token

The commit/push step sets GITHUB_TOKEN in env, but git push authenticates using the credentials persisted by actions/checkout (the default GITHUB_TOKEN), so setting an OPERATOR/ARCHWIZ token in env has no effect here. If the intent is to push with the privileged PAT (e.g. to bypass branch protection or trigger downstream workflows), the token must be passed to actions/checkout via with: token: or configured in the remote URL.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +378 to +387

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.

📝 Info: Hourly auto-commits of the lag index create ongoing default-branch churn

The lag index is recomputed from live PR data every hour and committed whenever any byte differs, so averages will almost always shift and produce a commit per hour on github.ref. Combined with the recomputation cost (2 API calls per PR for up to 50 PRs at scripts/ci/calculate_lag_index.py:109-111), consider only committing when the suggested windows change materially, or storing the index as a workflow artifact/cache instead of in git.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +375 to +387

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.

🟨 Sweep automation escalated to write access to repository contents

.github/workflows/agent-continuous-ops.yml raises the sweep job from contents: read to contents: write and adds a step that commits and pushes generated files to ${{ github.ref }} using an OPERATOR/ARCHWIZ admin PAT when available. An unattended hourly job with push rights to the default branch widens blast radius: any bug or injected content in scripts/ci/calculate_lag_index.py output is committed automatically without review, bypassing the repo's dual-gate merge policy in AGENTS.md.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

21 changes: 15 additions & 6 deletions .github/workflows/gemini-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,21 @@ jobs:
const number = context.payload.pull_request?.number || context.payload.issue?.number;
if (context.payload.comment?.id) {
try {
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes',
});
if (context.eventName === 'pull_request_review_comment') {
await github.rest.reactions.createForPullRequestReviewComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes',
});
} else {
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes',
});
}
Comment on lines +134 to +148

@devin-ai-integration devin-ai-integration Bot Aug 11, 2026 •

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.

📝 Info: Review-comment reaction split is the right API pairing

createForIssueComment fails with 404 for pull_request_review_comment payloads because review comments live under a different endpoint; branching on context.eventName fixes a previously silently-swallowed error (the catch at .github/workflows/gemini-dispatch.yml:143-145 only logged it). Note pull_request_review events have no payload.comment, so they never reach this branch.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

} catch (e) {
core.info('Comment reaction skip: ' + e.message);
}
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,17 @@ Use this ladder when orienting in the tree. `_Entry+ReadMe.md` and `termux-ecosy
| Priority | Start here | What you get |
|----------|------------|--------------|
| 1 | `archwiz/TOOL_INDEX.md` | 28 tools / 7 categories — cockpit, forensic, autonomous, verification |
| 2 | `archwiz/CONCEPT_INDEX.md` | Concepts + status (built / reserved / not built) + feature backlog |
| 3 | `archwiz/REFERENCE_HUB.md` | Links to DATA_FLOW_MANIFEST, SYSTEM_MAP, func/llm indices |
| 4 | `archwiz/METHODOLOGY_INDEX.md` | Approaches tried, failures, what stuck |
| 5 | `archwiz/PROCEDURES.md`, `ARCHWIZARD_TASKS.md` | Runbooks and active tasks |
| 6 | `docs/RECON.md` (this RECON) | Branch/PR critique, refTemplates nesting gaps, prioritized proposals |
| 7 | `replit.md` on branch `critical-proposal` (PR #1) | Critical path/config issues and optimization proposals |
| 8 | `_Entry+ReadMe.md` | One-line command → entry table |
| 9 | `termux-ecosystem-architecture.html` | Visual ecosystem diagram |
| 10 | `refTemplates/README_RECOVERY.md` on `recreate/refTemplates-skeleton` | Metadata-only restore policy for refs |
| 0.1 | `workspace/*.md` `workspace/CAVEMAN_INDEX.md` `workspace/SYSTEM_MAP.md` `workspace/llm_map/{*.md,*.txt,*.json,*.jsonl}` | Full Ecosystem Mapping |
| 2 | `docs/ops/LANE_CONSOLIDATION_SSOT.md` | Master Consolidation, Timing Quotas/CoolDowns & Production Improvements SSOT |
| 3 | `archwiz/CONCEPT_INDEX.md` | Concepts + status (built / reserved / not built) + feature backlog |
| 4 | `archwiz/REFERENCE_HUB.md` | Links to DATA_FLOW_MANIFEST, SYSTEM_MAP, func/llm indices |
| 5 | `archwiz/METHODOLOGY_INDEX.md` | Approaches tried, failures, what stuck |
| 6 | `archwiz/PROCEDURES.md`, `ARCHWIZARD_TASKS.md` | Runbooks and active tasks |
| 7 | `docs/RECON.md` (this RECON) | Branch/PR critique, refTemplates nesting gaps, prioritized proposals |
| 8 | `replit.md` on branch `critical-proposal` (PR #1) | Critical path/config issues and optimization proposals |
| 9 | `_Entry+ReadMe.md` | One-line command → entry table |
| 10 | `termux-ecosystem-architecture.html` | Visual ecosystem diagram |
| 11 | `refTemplates/README_RECOVERY.md` on `recreate/refTemplates-skeleton` | Metadata-only restore policy for refs |
| 12 | `workspace/*.md` `workspace/CAVEMAN_INDEX.md` `workspace/SYSTEM_MAP.md` `workspace/llm_map/{*.md,*.txt,*.json,*.jsonl}` | Full Ecosystem Mapping |
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved

Quick command table (also in `_Entry+ReadMe.md`):

Expand Down
1 change: 1 addition & 0 deletions docs/ARCHW1Z-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ repo-gate → termux-smoke → language/provider → master
| `docs/schemas/session-ssot.md` | TER-10 Session SSOT |
| `docs/schemas/provider-capabilities.md` | Capability registry |
| `docs/SECURITY-REMEDIATION.md` | PR #3 A+B+C checklist |
| `docs/ops/LANE_CONSOLIDATION_SSOT.md` | Master Consolidation & Production improvements |

---

Expand Down
Loading