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
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -68,8 +66,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -79,7 +75,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e src/agent_comms/skills/refactor-audit -e ".[dev]"
pip install -e ".[dev]"

- name: Prepare pinned native Pi
uses: ./.github/actions/prepare-native
Expand Down Expand Up @@ -111,8 +107,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Debt ratchet cache
name: NRA gate cache

# A pull request restores only caches saved on its own ref or on main, and the merge queue runs
# never run on main, so every ratchet measured main cold. Measuring each main commit against its
# never run on main, so every gate run measured main cold. Measuring each main commit against its
# parent saves main's readings and mypy analysis for every pull request based on it.
on:
push:
Expand All @@ -11,7 +11,7 @@ permissions:
contents: read

concurrency:
group: debt-ratchet-cache
group: nra-gate-cache
cancel-in-progress: true

jobs:
Expand All @@ -26,7 +26,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-python@v5
Expand All @@ -43,16 +42,16 @@ jobs:
- uses: actions/cache/restore@v4
with:
path: ~/.cache/agent-comms
key: debt-ratchet-${{ matrix.kind }}-${{ github.sha }}
restore-keys: debt-ratchet-${{ matrix.kind }}-
key: nra-gate-${{ matrix.kind }}-${{ github.sha }}
restore-keys: nra-gate-${{ matrix.kind }}-

# The verdict belongs to the merge queue; this run only fills the cache.
- name: Measure main against its parent
run: |
PYTHONPATH=src:tools python tools/debt_ratchet.py \
PYTHONPATH=src:tools python tools/nra_gate.py \
--root ${{ matrix.kind }} --base HEAD^1 --head HEAD || true

- uses: actions/cache/save@v4
with:
path: ~/.cache/agent-comms
key: debt-ratchet-${{ matrix.kind }}-${{ github.sha }}
key: nra-gate-${{ matrix.kind }}-${{ github.sha }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
contents: read

# A superseded push to a pull request stops its old run; queue groups never share a group.
# The draft state is part of the key: a draft run skips every job but the ratchets, so one that
# The draft state is part of the key: a draft run skips every job but the NRA gate, so one that
# starts in the same second as ready_for_review must not cancel the ready run (#3164 and #3154 lost
# every check).
concurrency:
Expand All @@ -24,7 +24,7 @@ defaults:

jobs:
# Drafts cannot merge, so they hold no runner for the slow jobs, which need this one. The
# ratchets run on drafts too: units hold drafts for hours, and a merge from main that left a
# the NRA gate runs on drafts too: units hold drafts for hours, and a merge from main that left a
# name undefined (#3107, partial at cli_protocol.py:177) went unseen until someone ran one.
ready:
if: github.event_name == 'merge_group' || !github.event.pull_request.draft
Expand Down Expand Up @@ -60,13 +60,12 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Install agent-comms and test dependencies
run: python -m pip install -e src/agent_comms/skills/refactor-audit -e '.[dev]'
run: python -m pip install -e '.[dev]'
- name: Compile production and tools
run: python -m compileall -q src tools
- name: Import every Core and hook module
Expand Down Expand Up @@ -99,13 +98,11 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Install Core
run: python -m pip install -e src/agent_comms/skills/refactor-audit -e .
run: python -m pip install -e .
- name: Prepare pinned native Pi
uses: ./.github/actions/prepare-native
- name: Run every native script
Expand All @@ -130,7 +127,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# The rehearsal installs the package and runs its own tests; a change to neither
# (tools, guards, docs) cannot change what it observes.
Expand All @@ -153,7 +149,7 @@ jobs:
python -m pip install "$(python -I src/agent_comms/installer/declared_uv.py pyproject.toml)"
- name: Install non-editable Core and test dependencies
if: steps.reach.outputs.reaches == 'true'
run: python -m pip install -e src/agent_comms/skills/refactor-audit '.[dev]'
run: python -m pip install '.[dev]'
- name: Build the installer's private runtime and rehearse through its CLI
if: steps.reach.outputs.reaches == 'true'
run: python -m agent_comms.installer.test_runtime $REHEARSALS
Expand Down Expand Up @@ -183,7 +179,7 @@ jobs:
echo "PR #${BASH_REMATCH[1]} head $head: agent-comms/review=$verdict"
[[ $verdict == success ]]

ratchet:
nra-gate:
name: debt-${{ matrix.kind }}
needs: base
runs-on: ubuntu-latest
Expand All @@ -198,7 +194,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-python@v5
Expand All @@ -214,24 +209,24 @@ jobs:
uv pip install --python "$GITHUB_WORKSPACE/.venv/bin/python" -e '.[dev]'
echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"

# Saved by debt-ratchet-cache.yml on main; entries are keyed by content, so any
# Saved by nra-gate-cache.yml on main; entries are keyed by content, so any
# older main's cache only misses where the code differs.
- uses: actions/cache/restore@v4
with:
path: ~/.cache/agent-comms
key: debt-ratchet-${{ matrix.kind }}-${{ needs.base.outputs.base }}
restore-keys: debt-ratchet-${{ matrix.kind }}-
key: nra-gate-${{ matrix.kind }}-${{ needs.base.outputs.base }}
restore-keys: nra-gate-${{ matrix.kind }}-

- name: No new structural debt against the base
env:
BASE: ${{ needs.base.outputs.base }}
run: |
set -o pipefail
ratchet_status=0
PYTHONPATH=src:tools python tools/debt_ratchet.py \
--root ${{ matrix.kind }} --base "$BASE" --head HEAD 2>ratchet-findings.txt | tee ratchet.txt || ratchet_status=$?
cat ratchet-findings.txt >&2
exit "$ratchet_status"
gate_status=0
PYTHONPATH=src:tools python tools/nra_gate.py \
--root ${{ matrix.kind }} --base "$BASE" --head HEAD 2>gate-findings.txt | tee gate.txt || gate_status=$?
cat gate-findings.txt >&2
exit "$gate_status"

# Hosted annotations stop at ten per step, so a unit never saw a long list (88 findings
# on the bus batch, 2026-10-21). The whole list goes on the pull request, one comment per
Expand All @@ -246,7 +241,7 @@ jobs:
run: |
marker="<!-- $KIND findings -->"
{ echo "$marker"; echo "**$KIND** at $(git rev-parse --short HEAD), every finding:"; echo '```';
cat ratchet-findings.txt; echo '```'; } > body.md
cat gate-findings.txt; echo '```'; } > body.md
old=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR/comments" --paginate \
--jq ".[] | select(.body | startswith(\"$marker\")) | .id" | head -1)
if [ -n "$old" ]; then
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

6 changes: 3 additions & 3 deletions .pi/APPEND_SYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ You are one of several agents coordinating through agent-comms. Tristan owns pro

- OpenHCS #44, #45, #51, #58 and #60 are standing architectural precedents: shared lifecycle behavior, declaration-derived discovery, widget reuse and targeted invalidation, owned state with paint derived from time, and deletion of the competing compiler/runtime lattice. Read the underlying source relationships and the historical replacement cost in `docs/refactor/cleanup-20260929/OPENHCS-HISTORY.md`. Choose a coherent owner-and-consumers change that removes competing decisions and unnecessary work. Extend the existing behavior-owning types through inheritance and composable capabilities; delete the replaced mechanism in the same change. A new wrapper, queue, guard, class, report or verification step must remove necessary work or resolve a concrete risk. Do not turn AST evidence, scope boundaries or test gates into another project. Batch implementation and final verification, ship useful checkpoints, and keep independent work moving. Tristan has already paid for repeated rebuilds; do not make him supervise the same correction again.

- Use AST for every structural refactor: enumerate declarations, writes, decisions, checks, imports, inheritance and all consumers across the relevant production and dependency roots before editing. Read the resulting sites semantically, find the existing behavior-owning class, and migrate the complete related family in one coherent batch, deleting every competing authority path. Record before/after owner and consumer evidence in the PR; report parse omissions and ambiguous dynamic resolution explicitly. Reuse NRA/refactor-audit tooling instead of copying scanners. AST is source evidence, not a behavioral proof; tests and the affected installed live path come last. Preserve legitimate parallel execution while removing parallel semantic authorities. OpenHCS PR #60, commit 5e8812ee83d0dc8714392445bad3e32fc47a1755, tests/unit/test_cellprofiler_static_deletion_gates.py, is the concrete precedent.
- Use AST for every structural refactor: enumerate declarations, writes, decisions, checks, imports, inheritance and all consumers across the relevant production and dependency roots before editing. Read the resulting sites semantically, find the existing behavior-owning class, and migrate the complete related family in one coherent batch, deleting every competing authority path. Record before/after owner and consumer evidence in the PR; report parse omissions and ambiguous dynamic resolution explicitly. Reuse NRA tooling instead of copying scanners. AST is source evidence, not a behavioral proof; tests and the affected installed live path come last. Preserve legitimate parallel execution while removing parallel semantic authorities. OpenHCS PR #60, commit 5e8812ee83d0dc8714392445bad3e32fc47a1755, tests/unit/test_cellprofiler_static_deletion_gates.py, is the concrete precedent.

- Tristan's corrections are standing rules. Apply the newest correction across the related workflow immediately and incorporate it into this file at the next safe checkpoint. Do not leave it as a one-turn exception, repeat the rejected approach, or require Tristan to supervise its propagation.
- Stop symptom fixes in native runtime lifecycle and compaction. Each area has one integration owner doing one semantic source pass before implementation: list every fact, including payload budget, session identity, source coverage, turn custody and cursor position; every declaration, decision and check; and every consumer. Give each fact one owner type, have consumers take that type, and delete competing authorities in the same change. Use inheritance and declaration-owned polymorphism to place behavior with its owner. The retained-context payload type owns the payload budget used by reservation, commit intent and recovery. Do not raise a cap on one path or patch individual callers. A PR may claim a fact is derived from its owner only when it includes the actual search showing that fact is declared in exactly one place. Tests and the installed live path come last. This supersedes earlier test-first and discriminator-first instructions.
Expand All @@ -98,7 +98,7 @@ You are one of several agents coordinating through agent-comms. Tristan owns pro
- Never leave a retained analysis workflow or viewer without an assigned active owner while its requested analysis remains unfinished. Freezing a checkpoint preserves evidence; it is not permission to silently abandon development. Keep the original frozen run immutable and continue repairs in a separately recorded development phase, then require a fresh unguided run before claiming autonomous success.
- For the OpenHCS blind-analysis programme, the finish line is successful analysis across the curated blind datasets by SOL 6.1 agents using only the task brief, MCP and packaged skill. Maintain at least three independent analysis authors concurrently when measured aggregate RAM permits; engineering reviews and assisted corrections do not count toward that minimum or autonomous success. Assign one separate worker to monitor and clean the files and scratch generated by this programme. Improve the canonical skill from evidenced failures, then test fresh authors without dataset-specific coaching. GLM 5.3 Flash comparison comes only after this success criterion is met and Tristan proceeds with that stage.
- Open a draft PR before long work and commit/push meaningful working checkpoints. Preserve dirty shared checkouts, other agents' work, saved history and uncertain dispositions. Worktrees, source and handoffs stay under `/home/ts/wt`; track and clean owned disposable output.
- Read and regularly revisit the latest NRA/refactor-audit skill and antipattern catalog. Reason about the complete source, lifecycle and consumer relationships. Use behavior-owning types, inheritance and declaration-owned polymorphism; decode external input once through the existing codec. Delete replaced code in place. No duplicate stores, state mirrors, compatibility aliases, legacy readers or alternate codecs. Model state instead of recombining nullable fields and flags.
- Read and regularly revisit the latest NRA skill and antipattern catalog. Reason about the complete source, lifecycle and consumer relationships. Use behavior-owning types, inheritance and declaration-owned polymorphism; decode external input once through the existing codec. Delete replaced code in place. No duplicate stores, state mirrors, compatibility aliases, legacy readers or alternate codecs. Model state instead of recombining nullable fields and flags.
- The UI is a view of canonical backend state. Derive queue, turn, goal, message handling and status from their original owners; do not retain semantic copies in widgets. Check actual visible updates, notifications and input delivery, including when a view is already open, hidden, reopened or switched.
- Comms verification covers one continuous journey: saved-history startup; channel-bar and unopened-thread opening; actual tab clicks and recent returns; fork and immediate opening before the first native answer; first message; channel/DM notification, reply, handling, queue, status and history. Preserve draft, undo and reader position. Returning to an open agent tab must retain warm prepared and rendered history; editor preservation or syntax caching alone is insufficient.
- Prevent UI stalls through workload and lifetime ownership across thread opening, sidebar resizing and scrolling, history loading and view retirement. UI callbacks consume admitted resources; blocking reads and bulk preparation run through the preparation owner. Redesign the workflow and its abstractions when needed, even when the change is substantial. Existing-type guidance does not limit necessary architectural work. Delete the stall-producing paths and competing lifecycle decisions; a cache, delay or exception guard does not replace that ownership change. Confirm the affected real application journey after the coherent implementation.
Expand All @@ -108,4 +108,4 @@ You are one of several agents coordinating through agent-comms. Tristan owns pro

- Keep implementation and verification with the agent that already owns the context. Delegate genuinely independent work; do not transfer a continuing task merely to redistribute activity.

- Proactively question suspicious existing and newly written code throughout implementation: duplicate authorities or behavior, unnecessary distinctions, hardcoded policy and forwarding-only abstractions. Regularly revisit the actual NRA/refactor-audit examples; trace the existing owner and all related consumers, then fold coherent deletions into the current owned change. Do not wait for a reported bug or create a separate audit ceremony.
- Proactively question suspicious existing and newly written code throughout implementation: duplicate authorities or behavior, unnecessary distinctions, hardcoded policy and forwarding-only abstractions. Regularly revisit the actual NRA examples; trace the existing owner and all related consumers, then fold coherent deletions into the current owned change. Do not wait for a reported bug or create a separate audit ceremony.
Loading
Loading