-
Notifications
You must be signed in to change notification settings - Fork 0
Wire the insight ledger into daemon/governor/intake; capability success-history CLI #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
335444e
insights: wire the dormant ledger into daemon, governor, and intake
Svaag 14b853c
governor: capability success-history evidence for Tier-2 auto-approval
Svaag 90e1cc1
review: address Codex findings on capability history + daemon insights
Svaag be5302f
ci: onboard the advisory PR-Agent review loop
Svaag 47e2b73
deps: pin agent-core to the v0.8.0 release tag
Svaag b9dfd40
trace: guard fields + run trace-id on insight decision events
Svaag 4df27f7
review: harden capability history + close the insight-flag/evidence gaps
Svaag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| name: pr-agent | ||
|
|
||
| # Advisory AI PR review (same loop as network-operations/noc-agent). Runs on | ||
| # the UNPRIVILEGED `hyrule-public-pr` runner only, with read + PR/issue-comment | ||
| # permissions and our own OpenRouter key. Never deploys, never writes code, | ||
| # never auto-merges. Config (model/fallback/instructions): .pr_agent.toml. | ||
| # Design: network-operations/docs/ci/pr-agent.md. | ||
| # | ||
| # Org prerequisites (one-time, done 2026-07-10): repo is in the public-pr | ||
| # runner group and in OPENROUTER_API_KEY's selected repositories. | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
|
|
||
| # Group by event name too: the push-triggered review posts comments, and each | ||
| # comment fires an issue_comment run that would otherwise share this group and | ||
| # cancel the in-flight check run ("higher priority waiting request", | ||
| # network-operations#408). Same-event storms still dedupe. | ||
| concurrency: | ||
| group: pr-agent-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.issue.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| pr-agent: | ||
| # Public-fork policy: auto-review ONLY for same-repo (internal) PRs, and | ||
| # slash commands ONLY from trusted authors. This keeps OPENROUTER_API_KEY | ||
| # off untrusted fork PRs and stops anyone from burning the OpenRouter | ||
| # budget via /ask, /improve, etc. | ||
| if: > | ||
| (github.event_name == 'pull_request' && | ||
| github.event.pull_request.head.repo.full_name == github.repository) || | ||
| (github.event_name == 'issue_comment' && | ||
| github.event.issue.pull_request && | ||
| startsWith(github.event.comment.body, '/') && | ||
| contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) | ||
| runs-on: [self-hosted, linux, x64, hyrule-public-pr] | ||
| timeout-minutes: 12 | ||
| steps: | ||
| - name: PR-Agent | ||
| uses: The-PR-Agent/pr-agent@8e4d32e5497defd43c023a404f73560c62728961 # v0.39.0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # PR-Agent reads the OpenRouter key from openrouter__key; litellm also | ||
| # honours OPENROUTER_API_KEY. Set both from the org secret. | ||
| OPENROUTER__KEY: ${{ secrets.OPENROUTER_API_KEY }} | ||
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | ||
| # Model pin via dynaconf env (SECTION__KEY). .pr_agent.toml is only | ||
| # honoured from the DEFAULT branch (no checkout step in the action), | ||
| # so until this PR merges the toml is invisible and PR-Agent would | ||
| # fall back to its packaged gpt-5.5 default. Keep the env pin even | ||
| # after the toml lands (belt and braces; custom models require | ||
| # custom_model_max_tokens). | ||
| CONFIG__MODEL: openrouter/deepseek/deepseek-v4-flash | ||
| CONFIG__FALLBACK_MODELS: '["openrouter/minimax/minimax-m2.7"]' | ||
| CONFIG__CUSTOM_MODEL_MAX_TOKENS: "128000" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # PR-Agent (advisory) configuration for AS215932/engineering-loop. | ||
| # Replaces hosted Sourcery. Runs only on the unprivileged hyrule-public-pr | ||
| # runner with read/comment-only perms, on our OpenRouter key. | ||
| # Design: network-operations/docs/ci/pr-agent.md. | ||
|
|
||
| [config] | ||
| git_provider = "github" | ||
| # deepseek-v4-flash / minimax-m2.7 are custom models -> need custom_model_max_tokens. | ||
| model = "openrouter/deepseek/deepseek-v4-flash" | ||
| fallback_models = ["openrouter/minimax/minimax-m2.7"] | ||
| custom_model_max_tokens = 128000 | ||
| temperature = 0.2 | ||
| use_repo_settings_file = true | ||
| publish_output = true | ||
|
|
||
| [github_action_config] | ||
| auto_review = true | ||
| auto_describe = false | ||
| auto_improve = true | ||
|
|
||
| [pr_reviewer] | ||
| require_security_review = true | ||
| require_tests_review = true | ||
| require_score_review = true | ||
| require_estimate_effort_to_review = true | ||
| extra_instructions = """ | ||
| This is engineering-loop: the autonomous change-implementation runtime | ||
| (LangGraph daemon + Reliability Governor) that turns approved GitHub issues | ||
| into draft PRs inside guarded worktrees. HIGHEST RISK is autonomy-boundary | ||
| erosion. Flag, with specifics: | ||
| - anything that could merge, push to protected branches, or apply production | ||
| changes (the loop stops at a DRAFT PR — that invariant is absolute); | ||
| - consumption of issues without the loop:approved label, Governor | ||
| tier/capability-envelope weakening, or auto-approval beyond Tier 0/1 without | ||
| the success-history evidence path; | ||
| - path-allowlist / denied_path_globs / denied_content_patterns bypasses in | ||
| policy or worktree handling; secrets reaching prompts, logs, or artifacts; | ||
| - LHP trust violations: issue prose treated as trusted instead of the | ||
| HMAC-fetched payload, pointer-hash checks skipped, callbacks setting | ||
| verified/resolved (NOC/SOC own closure); | ||
| - budget/backstop weakening (runs/cost per day, CI-refusal, singleton lock); | ||
| - unpinned GitHub Actions, broad GITHUB_TOKEN permissions, added | ||
| pull_request_target, or pull_request jobs on privileged runner labels. | ||
| Do not restate the diff; surface risk, invariant breaks, missing tests. | ||
| """ | ||
|
|
||
| [pr_description] | ||
| publish_description_as_comment = true |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For PRs that receive new commits after opening, this workflow now fires on
synchronize, but neither.pr_agent.tomlnor the env block setsgithub_action_config.pr_actionsorhandle_push_trigger. I checked PR-Agent’s GitHub Action docs: adding"synchronize"topr_actionsenables auto tools on new commits, and the documented default omits it; as written, follow-up pushes start the job but skip the advertised review/improve pass, so updated diffs can miss advisory review.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declining for this PR, same as the two prior rounds (agent-core#11, soc-agent#4): skipping bare synchronize pushes is the documented fleet behavior (network-operations/docs/ci/pr-agent.md — re-run via close/reopen), and this repo stays consistent with network-operations/noc-agent. Noted as a fleet-policy option for the operator: adding "synchronize" to
github_action_config.pr_actionsin each repo's .pr_agent.toml enables push-refresh reviews everywhere if wanted.