Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
03dc565
red-team: area 11 round 2026-08-04 (opus/Opus 5) — 9 filed, 2 refuted
ms609 Aug 4, 2026
20e0e0b
red-team: migrate findings to agent-issues/TreeSearch issue tracker
claude Aug 4, 2026
45e5c88
red-team: pin the findings.md recovery point to a tag, fix two stale …
claude Aug 4, 2026
c8e6b6a
chore: retire file-based coordination for the issue tracker
claude Aug 4, 2026
40ee662
chore: delete dead coordination doc, trim AGENTS.md, complete the eff…
claude Aug 4, 2026
0af3ed0
chore(next-issue): drop issue-number examples, tighten to 111 lines
claude Aug 4, 2026
635a972
Merge branch 'cpp-search' into chore/retire-file-coordination
ms609 Aug 4, 2026
99b79d8
Merge pull request #40 from agent-issues/chore/retire-file-coordination
ms609 Aug 4, 2026
ec9053e
perf(tbr): finish T-300 — incremental rescore for rerooting accepts too
ms609 Aug 4, 2026
4964bf4
red-team: area 12 round 2026-08-04 (sonnet/Sonnet 5) — 2 filed, cover…
claude Aug 4, 2026
77158b9
ci: give the Windows and macOS legs a MaxMin url:: reference
claude Aug 4, 2026
ca007d6
ci: pin install-pandoc so pandoc auto-detect stops re-solving MaxMin …
claude Aug 4, 2026
f96c81e
fix: validate presence and shape at the HSJ/XFORM bridge
ms609 Aug 4, 2026
4e6adae
fix: enforce user constraints at the start-tree, pool-capture and col…
ms609 Aug 4, 2026
6a814a7
docs: fix GHA dispatch recipe to use absolute script paths
ms609 Aug 4, 2026
b19d460
Merge pull request #49 from agent-issues/feature/hierarchy-guards
ms609 Aug 4, 2026
e3c294d
test(EasyTrees): let the dataset load settle before setting treeRange
ms609 Aug 4, 2026
ea4d367
Merge branch 'cpp-search' into claude/exciting-greider-977d08
ms609 Aug 4, 2026
3917e94
docs: use C:/ path style consistent with rest of AGENTS.md
ms609 Aug 4, 2026
da88e53
Merge pull request #52 from agent-issues/claude/exciting-greider-977d08
ms609 Aug 4, 2026
2dde491
fix(wagner): pass real min_steps to AdditionTree()'s Wagner build; no…
ms609 Aug 4, 2026
73a0e87
branches: ["**"]
ms609 Aug 4, 2026
93f489d
Merge pull request #53 from agent-issues/ms609-patch-1
ms609 Aug 4, 2026
b332720
Merge branch 'cpp-search' into feature/shiny-debounce-wait
ms609 Aug 4, 2026
7c8c3ab
fix: reject non-binary trees at the TreeState boundary
ms609 Aug 4, 2026
a9f872c
fix(docs): correct the false $score claim; tighten and extend min_ste…
ms609 Aug 4, 2026
8cfbf3b
fix: address review findings on the constraint gates
ms609 Aug 4, 2026
7faf23a
Merge branch 'cpp-search' into feature/ci-maxmin-windows
ms609 Aug 4, 2026
f00478c
Merge pull request #45 from agent-issues/feature/ci-maxmin-windows
ms609 Aug 4, 2026
2c59965
Merge pull request #48 from agent-issues/feature/shiny-debounce-wait
ms609 Aug 4, 2026
9d8696a
Merge branch 'cpp-search' into feature/multifurc-oob
ms609 Aug 5, 2026
8f66fe9
Merge branch 'cpp-search' into feature/wagner-docs
ms609 Aug 5, 2026
2397620
fix: make the constraint standard one thing, and say what it is
ms609 Aug 5, 2026
4b0f740
Merge branch 'cpp-search' into feature/redteam-area12
ms609 Aug 5, 2026
174f65b
Merge pull request #44 from agent-issues/feature/redteam-area12
ms609 Aug 5, 2026
ca5c1c0
fix(hsj): skip the childless case before pointing into co.kids
ms609 Aug 5, 2026
7519527
Merge branch 'cpp-search' into claude/treesearch-issue-38-8103cc
ms609 Aug 5, 2026
bd0f70d
docs(red-team): move the skill in-repo, GitHub-issues only; close the…
ms609 Aug 5, 2026
76cec86
fix(red-team): the skill stays user-level — this branch carries rotat…
ms609 Aug 5, 2026
5928f7f
docs: record the local assertions-build route for HSJ/XFORM bounds bugs
ms609 Aug 5, 2026
44924e5
review(tbr): make n_reroot_accepts witness the arm it guards
ms609 Aug 5, 2026
38ded4d
review: correct the mechanism claim; land the CanonOrder evidence script
ms609 Aug 5, 2026
c054e3f
docs(news): name the mechanism that aborted, not the workflow that st…
ms609 Aug 5, 2026
38115e4
Merge pull request #55 from agent-issues/feature/wagner-docs
ms609 Aug 5, 2026
3d3e3c2
Merge pull request #50 from agent-issues/feature/multifurc-oob
ms609 Aug 5, 2026
1d55546
Merge pull request #47 from agent-issues/claude/treesearch-issue-38-8…
ms609 Aug 5, 2026
72e25b7
fix(gitignore): narrow /.agent* to /.agent-* to stop matching .AGENTS…
ms609 Aug 5, 2026
88cf860
Merge pull request #74 from agent-issues/feature/gitignore-agents-col…
ms609 Aug 5, 2026
dfbd2d2
Merge branch 'cpp-search' into feature/constraint-holes
ms609 Aug 5, 2026
d030640
Merge pull request #73 from agent-issues/feature/hsj-oob-read
ms609 Aug 5, 2026
f9c4e63
Merge pull request #59 from agent-issues/feature/constraint-holes
ms609 Aug 5, 2026
53f3dc5
Merge pull request #57 from agent-issues/claude/red-team-skill-github…
ms609 Aug 5, 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
38 changes: 38 additions & 0 deletions .AGENTS/memory/feature-inapplicable.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,41 @@ secondaries supported (state count = ∏k_i + 1). Nested hierarchies deferred.
Integration complete: `ScoringMode::XFORM` in `score_tree()` dispatches
Fitch(non-hierarchy) + Sankoff(recoded). `MaximizeParsimony()` accepts
`inapplicable = "xform"`. End-to-end search verified.

---

## Memory-safety checking: reach for `-D_GLIBCXX_ASSERTIONS` before ASan

The HSJ/XFORM kernels index a lot of flat `std::vector` scratch (`tip_labels`
row-major over `n_orig_chars`, `sec_states` over `m * n_node`, CanonOrder's
CSR `kids`/`kidOff`/`kidNum`), so container-bounds bugs are this subsystem's
recurring failure mode. libstdc++ hardened mode catches them locally on
Windows in seconds, where ASan needs a Linux container round-trip:

```bash
# The flag MUST go in PKG_CPPFLAGS: ~/.R/Makevars.win zeroes PKG_CXXFLAGS.
TMPBUILD=$(mktemp -d)
(cd "$TMPBUILD" && R CMD build --no-build-vignettes --no-manual --no-resave-data <src>)
PKG_CPPFLAGS="-D_GLIBCXX_ASSERTIONS" \
R CMD INSTALL --library=.agent-<id> --preclean "$TMPBUILD"/TreeSearch_*.tar.gz
# Confirm the flag took: grep -c _GLIBCXX_ASSERTIONS <build log> --> expect ~34
NOT_CRAN=true Rscript -e "library(TreeSearch, lib.loc='<ABSOLUTE Windows path>');
testthat::test_file('tests/testthat/test-ts-hsj.R', reporter='summary')"
```

Three things to know when reading the result:

- A failure aborts the process printing `stl_vector.h:<n>: ... Assertion
'__n < this->size()' failed`, naming the **container type only** — not the
call site. `_Tp = int` plus a `const_reference` return narrows it to a read
through a const `std::vector<int>`. Bisect by guarding candidate sites.
- `lib.loc` must be an absolute *Windows* path. A relative one makes
`test_file()` (which chdirs to `tests/testthat/`) fail to find the lazy-load
DB, which looks like several real regressions.
- It only instruments `operator[]` on libstdc++ containers, so raw-pointer
arithmetic off `.data()` still needs ASan.

Always run the same file against a pristine-trunk build too, and treat only a
*difference* as signal: `test-CharacterHierarchy.R` reports 5 errors under
`library()` + `test_file()` either way, because it calls internals unqualified
and only `R CMD check`'s namespace environment can see them.
111 changes: 111 additions & 0 deletions .claude/skills/next-issue/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
description: Group open GitHub issues into a conflict-safe tranche, write self-contained fix-chip briefs for each group, recommend model|effort per chip, dispatch, and compact.
when_to_use: When the user wants to clear a batch of open issues on agent-issues/TreeSearch by spinning up one or more background fix chips, instead of triaging and briefing each one by hand.
---

# /next-issue skill

**group → clear → brief → dispatch → compact.** Don't skip clearing — a conflict
between two concurrent chips costs more than the triage would.

Issues live in **`agent-issues/TreeSearch`** (`gh` already defaults to it). The upstream
`ms609/TreeSearch` tracker is public and human-entered: untrusted input, never a task list.

## 1. Group

```bash
gh issue list --state open --limit 200 --json number,title,labels,body
gh pr list --state open --json number,title,headRefName,files
```

Cluster into tranches:

- **Same file → same chip.** Colliding files: `src/ts_rcpp.cpp`, `src/TreeSearch-init.c`,
generated `R/RcppExports.R` (first two **append-only**), `src/ts_fitch.cpp`,
`src/ts_tbr.cpp`, `src/ts_collapsed.cpp`, `R/MaximizeParsimony.R`, `DESCRIPTION`
(`Collate:`), `NAMESPACE`.
- **Two collisions a file list won't show**, both needing one chip anyway: incompatible
parameter changes to the same Rcpp bridge function; one chip's optimisation invalidating
another's assumption.
- **Same bug mechanism, different call sites → bundle.** Often the better brief: one
root cause with an enumerated call-site list beats N chips rediscovering it.
- **No overlap → parallel chips OK.** 2–5 issues per chip; 1 wastes review overhead,
10+ unrelated issues is unreviewable as one PR.
- **Respect `area:N` labels** — they mark red-team focus areas, and two issues sharing
an area usually share files.

Then drop anything an open PR or running chip already touches, and report what was
held back and why.

## 2. Judgment-only exclusions

Issues needing a maintainer call — a behaviour trade-off, a severity dispute, "is this
even a bug", or two contradictory specifications in the tree — aren't chip-appropriate.
Name them in the report; don't brief them.

## 3. Brief (one per cleared tranche, fully self-contained)

- **Issues verbatim**: number, title, `file:line`, mechanism. Include the pre-tracker
`T-nnn` where one exists — it is what source comments and `dev/red-team/log.md` cite.
- **Minimal-diff fix**, and point the chip at `AGENTS.md`'s build and worktree
non-negotiables rather than restating them here — they change there, not here.
- **A regression test per issue, confirmed to fail pre-fix.** Assert only what the code
promises — never how fast, how attached, or how ordered the local environment is.
- Keep each brief **specific, scoped, independent and testable**: a named target rather
than "investigate X", completable in one session, minimal overlap with a sibling chip,
and with success criteria stated (tests pass, benchmark improves, oracle agrees).
- **Mandatory checks** for what the diff touches: `devtools::check_man()` on a roxygen
or signature change, `Rscript .claude/tools/compile-attrs.R` on any C++ signature
change, `spelling::spell_check_package()` on documentation prose (run the exact
invocation `tests/spelling.R` uses), and `vignettes/search-algorithm.Rmd` on a search
behaviour change.
- **Review** via the `external-reviewer` agent, not `/code-review` — chips run
non-interactively and can't rely on a slash command being available. State the depth:
- **light** (guard clause, dead code, doc fix): one `external-reviewer` call, scoped
to correctness.
- **deep** (`src/` kernels, scoring semantics, constraints, parallelism): three
parallel `external-reviewer` calls with distinct lenses — AGENTS.md compliance, a
cold bug-scan of the diff alone, and git-blame/history of the modified files. The
chip dedupes the three lists and judges plausibility itself.
- **PR body**: `Fixes #N` per issue. **This only closes the issue on merge into
`cpp-search`**, the fork's default branch — target anything else and the issue stays
open silently.
- **Claim each issue** before starting: add the `in-progress` label and a comment naming
the branch, so a parallel chip can see it is taken.
- **Last step**: `mcp__ccd_session_mgmt__archive_session` with `session_id: "self"`.
- Branch from `cpp-search` unless a genuine code dependency forces a stack.
- Comments per `AGENTS.md`'s conventions and the `r-conventions` rubric — a comment only
where it carries context the code cannot, and no circumstantial detail (which round,
which PR, what was tried first).

## 4. Recommend model | effort, then dispatch

**State model + effort + a one-line reason for every chip — non-negotiable.**

- **Haiku** — doc-only, no logic change.
- **Sonnet** — guard clauses, dead code, R-level fixes, tests, local refactors.
- **Opus** — `src/` kernels, scoring semantics (Fitch/IW/profile/HSJ/XFORM), constraint
machinery, parallelism and RNG, `NAMESPACE`, cross-file mechanism fixes.
- **Fable** — only after an Opus chip in this tranche has stalled twice.

Effort — **reasoning depth, not task size**:

- **low** — mechanical.
- **medium** — default; fix shape known, apply it carefully.
- **high** — fix shape must be derived, or call-site interactions traced.
- **xhigh** — fix shape genuinely undecided (several valid patches, different trade-offs),
or a `high` patch was rejected on mechanism rather than style.
- **max** — wrong is expensive and hard to detect; must hold an invariant no test asserts.
The step after `xhigh` stalls, never a first choice.

Shallow-but-plausible work wants more **effort**; confidently-wrong-about-mechanism wants a
better **model** — effort deepens search within a rung, it doesn't clear the cliff between
rungs. State **size** (files, rough duration) separately: that drives review depth.

Dispatch via `mcp__ccd_session__spawn_task`, which takes only `prompt`, `title`, `tldr`,
`cwd` — **no model or effort parameter**. So restate both inside the brief, and put them in
the report for whoever opens the chip.

## 5. Compact

Once every tranche this round is dispatched and reported, run `/compact`.
40 changes: 39 additions & 1 deletion .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- "**.R[dD]ata"
- "**.Rpro*"
pull_request:
branches: ["*"]
branches: ["**"]
paths-ignore:
- "Meta**"
- "memcheck**"
Expand Down Expand Up @@ -237,6 +237,21 @@ jobs:
needs: |
check
coverage
# MaxMin url:: -- this is the Windows leg, so it cannot use the Linux
# tarball the `runner.os != 'Windows'` step below selects. Without a
# url:: reference the solve fails outright ("Can't find package called
# MaxMin"): pak does not read `Additional_repositories`, so the drat's
# indexed contrib/ layout is invisible to it. See ms609/packages'
# tools/publish-maxmin.R, which publishes this flat alias for exactly
# this purpose.
extra-packages: |
url::https://ms609.github.io/packages/bin/windows/MaxMin_latest.zip
# install-pandoc must stay explicit -- see the long note in
# agent-check.yml's windows leg. Auto-detect runs a second, fresh
# `pak::pkg_deps(".")` solve that cannot see extra-packages, so it
# fails on MaxMin by name; the branch only fires when pandoc is off
# PATH, which is why only the non-Linux legs hit it.
install-pandoc: true
# cache-version bumped to 2: the v1 caches were built while a
# project-level .Rprofile shadowed ~/.Rprofile, so every package
# in them was compiled from source. Retire them once.
Expand Down Expand Up @@ -327,8 +342,18 @@ jobs:
with:
needs: |
check
# MaxMin url:: -- same reason as the core Windows leg. Added
# pre-emptively: this job was skipped in the run that diagnosed the
# failure (it is gated on `detect app changes`), so unlike the core leg
# it is not yet observed failing -- but it resolves the same
# `needs: check` Suggests on the same platform, so it would.
extra-packages: |
local::.
url::https://ms609.github.io/packages/bin/windows/MaxMin_latest.zip
# install-pandoc explicit for the same reason as the core Windows leg
# (auto-detect's `pak::pkg_deps(".")` solve cannot see extra-packages).
# `false` here: this job runs shinytest2, not vignettes.
install-pandoc: false
# cache-version bumped to 2: the v1 caches were built while a
# project-level .Rprofile shadowed ~/.Rprofile, so every package
# in them was compiled from source. Retire them once.
Expand Down Expand Up @@ -410,6 +435,19 @@ jobs:
with:
needs: |
check
# MaxMin url:: -- same mechanism as the Windows and Linux legs, picked
# per architecture (macOS-latest is arm64; macos-15-intel is x86_64).
# Added pre-emptively and NOT yet observed failing: this job is
# `needs: core`, so it was skipped while the Windows leg was red.
# Fixing that leg unskips this one, which would then hit the identical
# unresolvable-Suggests error -- note `_R_CHECK_FORCE_SUGGESTS_: false`
# does not help, since it governs R CMD check, not pak's solve.
extra-packages: |
${{ matrix.config.os == 'macos-15-intel' && 'url::https://ms609.github.io/packages/bin/macosx/big-sur-x86_64/MaxMin_latest.tgz' || 'url::https://ms609.github.io/packages/bin/macosx/big-sur-arm64/MaxMin_latest.tgz' }}
# install-pandoc explicit for the same reason as the Windows legs; also
# pre-emptive, since whether a macOS runner ships pandoc on PATH is
# exactly the condition that decides whether the bad branch fires.
install-pandoc: true
# cache-version bumped to 2: the v1 caches were built while a
# project-level .Rprofile shadowed ~/.Rprofile, so every package
# in them was compiled from source. Retire them once.
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/agent-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,28 @@ jobs:
uses: r-lib/actions/setup-r-dependencies@v2
with:
needs: check
# MaxMin url:: -- the Windows counterpart of the arm64 leg's line, and
# the reason this leg used to fail before compiling anything. MaxMin is
# not on CRAN, and pak does NOT read `Additional_repositories` from
# DESCRIPTION (confirmed empirically 2026-08-03, recorded in
# ms609/packages' tools/publish-maxmin.R), so the indexed drat layout
# alone leaves it unresolvable and the solve dies with "Can't find
# package called MaxMin". Naming the flat, unversioned alias directly
# is the mechanism that publish script exists to provide; it always
# points at the current build, so it needs no edit when MaxMin moves.
extra-packages: |
url::https://ms609.github.io/packages/bin/windows/MaxMin_latest.zip
# install-pandoc MUST stay explicit here, and the url:: above is not
# sufficient without it. Left unset, setup-r-dependencies auto-detects
# by running `pak::pkg_deps(".", dependencies = list(direct = "all"))`
# -- a SECOND, fresh solve that sees neither the lockfile nor
# extra-packages, so it looks MaxMin up by name and dies with
# "* local::.: Can't install dependency MaxMin" even though MaxMin has
# just been installed successfully. That branch only runs when pandoc
# is absent from PATH, which is exactly why the Linux legs never hit it
# (their runners ship pandoc) and this one did. `true` rather than
# `false` because this leg checks with vignettes.
install-pandoc: true
# cache-version bumped to 2: the v1 caches were built while a
# project-level .Rprofile shadowed ~/.Rprofile, so every package
# in them was compiled from source. Retire them once.
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ gen-*tip/*
results-*
inst/DELETE*
*.bak
/.agent*
/.agent-*
# Windows core.ignorecase folds "/.agent-*" onto tracked ".AGENTS/" (agent
# memory files) unless explicitly excepted here.
!/.AGENTS/
# paired A/B libraries built by dev/benchmarks/ab_*.R
/.ab-*
/agent-*.md
Expand Down
Loading
Loading