Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions .github/workflows/ci-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
permissions:
contents: read
issues: read
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -49,3 +50,12 @@ jobs:
gh api --paginate "repos/$GITHUB_REPOSITORY/labels" \
--jq '.[] | {name, description}' > "$RUNNER_TEMP/labels.jsonl"
python tools/check_labels.py "$RUNNER_TEMP/labels.jsonl"
- name: Inspect recently updated Issues and PRs
env:
GH_TOKEN: ${{ github.token }}
run: python tools/audit_issue_labels.py --recent-hours 48 --cutover-pr 681 > "$RUNNER_TEMP/issue-label-audit.json"
- uses: actions/upload-artifact@v4
with:
name: issue-label-audit
path: ${{ runner.temp }}/issue-label-audit.json
if-no-files-found: error
2 changes: 2 additions & 0 deletions docs/agent-collaboration.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ Change labels by editing `labels.json` in a PR first, then applying that change
repository. The nightly `safety-net` job reports drift between the repository labels and
`labels.json`, and any label that an Issue template or `tools/skill_eval_*_config.json`
references but `labels.json` lacks. No workflow writes labels.
The [per-object inspection and hourly handoff](guides/issue-label-audit.md)
explain how to read the nightly findings and verify an authorized writer's cutover.

[`external-labels.json`](../.github/external-labels.json) names the labels that an outside
GitHub App owns and applies, with the app that owns each one. Those names are exempt from the
Expand Down
26 changes: 26 additions & 0 deletions docs/guides/issue-label-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Inspect Issue and PR labels

The nightly `safety-net` job publishes an `issue-label-audit` JSON artifact for Issues and PRs updated in the preceding 48 hours. Consecutive windows overlap. Count distinct object and event IDs when combining runs. [Collaboration rules](../agent-collaboration.md#labels) · [Workflow](../../.github/workflows/ci-nightly.yml)

## Read a report

Run `python tools/audit_issue_labels.py 335 658` with an authenticated GitHub CLI that can read InferRSI Issues and PRs. Use `--recent-hours 48 --cutover-pr 681` instead of object numbers to reproduce the nightly selection. Each entry identifies the object, observed labels, PR head where applicable, suggested additions/removals and evidence links. A pending finding identifies missing evidence. Findings can be nonempty on a successful run. An unavailable API returns an error. The existing `tools/check_labels.py` independently fails on label definition or reference drift.

The optional `--evidence decisions.json` supplies a human reading of public records, keyed by object number. A proof has `url` and an exact `quote` from its body. For a parent Issue comment, add `via`, the URL of a record on the inspected object containing the parent link. The tool fetches that comment and verifies its quotation. Review the meaning and ownership before acting. Useful keys include:

- `open_question`, `scope_decision`, `whole_scope_acceptance`, `deferral`, `label_delegation`, `delivery`, `blocker` and `disposition`. For a suggested missing kind, pair `suggested_kind` with `kind_choice`. Pair a list of `suggested_areas` with an `area_scope` quote covering the named responsibilities. Conflicting acceptance and deferral evidence leaves the decision pending.
- `closer_login`, `closer_role` (`owner` or `delegate`), `closer_identity`, `owner_authority`, `goal_decision` and `closure_summary` identify who closed this open cycle and on what grounds. A delegated close also needs `closure_delegation`. A closure record must originate after the latest reopening, if any. Its current text and any local link to a parent decision must predate the native close. A later edit or an unresolved same-second ordering leaves the evidence pending. Interpret an explicit statement of capacity. One shared login may represent several actors.
- `standing_reviews` entries cite native `activity`. The activity or a reviewer-authored `role` proof identifies a standing reviewer. A formal PR review supplies its commit. For a comment supply `revision`, and for Issues also supply `issue_revision` identifying the current state. An `invitation` proof quotes the @ mention, request to review and revision. The latest version of the cited body or comment must predate the review. Missing evidence is pending. The uninvited count requires an explicit positive record from the standing reviewer.

## Reconstruct PR kinds at cutover

Pass `--cutover-pr 681` for [the inspection PR](https://github.com/InferMatrixLab/InferRSI/pull/681). Its GitHub `merged` timeline event supplies T, the event ID and the matching merge commit SHA. On each PR, `replayed` shows pre-T changes and `at_cutover` the reconstructed kinds. `new_additions` counts each distinct addition strictly after T, including re-additions on older PRs. A same-second boundary with unknown order or incomplete history stays pending. [Accepted cutover](https://github.com/InferMatrixLab/InferRSI/issues/658#issuecomment-7155913512)

An original `--snapshot snapshot.json` has an exact zoned `at` timestamp and an `objects` map from PR number to its observed `kind:*` list. An empty list is a recorded absence. Supply only original per-object evidence. The November 24 snapshot published 186 Issues and 323 PRs, with 176 PRs carrying kind. Its precise timestamp and object-label rows were unavailable at implementation. The separately measured Shanghai 30-day creation cohort contained 181 Issues and 319 PRs, including 184 with kind. The report preserves both published counts. A newly created post-T PR can be replayed from its creation. [Audit windows](https://github.com/InferMatrixLab/InferRSI/issues/658)

## Hand off the hourly classifier

1. When this inspector is ready to merge, the operator of “分类标签小时维护” pauses **every** remote label operation, invalidates all previously planned requests and retry generations, drains in-flight requests and records time, generation and zero queue/retry/in-flight counts on the PR. Keep the writer paused across T. [Owner and operator decisions](https://github.com/InferMatrixLab/InferRSI/issues/658#issuecomment-7155986059)
2. After the merge, record the actual GitHub merged event. With the writer still paused, run one complete read-only cycle that inspects a pre-existing open PR with no kind. Record the PR URL and head, opening state and labels, run ID/time, zero remote label requests for the whole run, and a separate GitHub readback. If no PR qualifies, record that and keep the writer paused. [Operator clarification](https://github.com/InferMatrixLab/InferRSI/issues/658#issuecomment-7154855391)
3. To check the operator's recorded fields and their timing, run `python tools/audit_issue_labels.py --cutover-pr 681 --handoff operator.json P`, where P was inspected. The `freeze` object records `at`, `url`, `scope: all-label-writes`, `invalidated_generation`, `queued`, `retries` and `in_flight`. The `trial` object records `at`, `url`, `run_id`, `pr_url`, `head`, `existing_open_pr`, `inspected`, `remote_label_requests`, `kinds_before`, `kinds_after` and a separate `readback_url`. Verify the linked operator logs, counters and independent GitHub readback before resuming. The CLI validates the supplied fields and timestamps.
4. Resume with a fresh generation and recheck every plan at send and retry time. Automatic additions are limited to documented areas with clear evidence. Issue kind and proposed status are suggestions. For a delegated status change verify the owner's recorded decision, an existing proposal and the applicable authority. Keep missing/partial acceptance and PR kind/status out of the writer. Preserve the body, record actual changes in the task history and use the report for routine findings. [Write authority](../agent-collaboration.md#labels)
Loading
Loading