Files
rune/docs/RESEARCH_CODE_CLASSIFICATION.md
T
Nick 3a22d99e9b
CI Pipeline / best-practices (push) Successful in 6s
Auto-label / priority-gate (pull_request) Skipped
CI Pipeline / canary (push) Successful in 34s
Auto-label / auto-label (pull_request) Successful in 3s
CI Pipeline / lint (push) Successful in 39s
CI Pipeline / documentation (push) Successful in 2s
CI Pipeline / gitea-offline (push) Successful in 15s
CI Pipeline / unit-tests (push) Failing after 54s
CI Pipeline / type-check (push) Successful in 29s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / gitea-offline (pull_request) Successful in 14s
CI Pipeline / lint (pull_request) Successful in 35s
CI Pipeline / required-checks (push) Successful in 1s
Spec gate (headless) / spec-gate (pull_request) Successful in 7s
CI Pipeline / type-check (pull_request) Successful in 27s
CI Pipeline / unit-tests (pull_request) Failing after 48s
CI Pipeline / canary (pull_request) Successful in 27s
CI Pipeline / required-checks (pull_request) Successful in 1s
feat(RP11): conservative retirement of superseded ResearchProcess paths (closes #274)
RP10 proven (PR #279 merged, v0.56.0) — retirement per doctrine:
REPLACEMENT PROVEN FIRST, RETIREMENT SECOND.

Step 1 — consolidate: merged rp2-canonical-stage-model into master
(zero conflicts). Master now carries the canonical stage model
(ISSUE→INWARD→OUTWARD→APPLICABILITY→conditional INNOVATION→ADVERSARIAL
(disposition)→SYNTHESIS→QUALIFY) plus the #161 harness.

Step 2 — retire (each classified before removal):
- scripts/research_backend.py: run_full_research() self-walking loop +
  --watch poll supervisor (SUPERSEDED, §26.6/26.7)
- scripts/run_research_stage.py + scripts/run_agent_stage.py (+ its test):
  legacy single-stage runners (SUPERSEDED; no live imports — research_artifact
  references build_receipt in a docstring only)
- .gitea/workflows/research-{dispatcher,stage-headless,backlog-sweep}.yml:
  legacy trigger paths (SUPERSEDED; trigger label stripped RP0)
- prompts/research-stages/{define,outward_discovery,outward_reading}.md:
  split-stage templates (concepts survive as outward.md subsections)
- repo-level research-pending trigger label deleted from Gitea (no issue
  carried it)

KEPT (canonical reuse / compatibility):
- research_artifact.py, research_event_relay.py, research_router.py,
  research_inward_context.py, research_prompt_compiler.py, research_define.py
  (ISSUE-gate compiler), research_task_tree.py + research_stage_executor.py
  (canonical authorities)
- RETIRED_STAGES guard: retired names remain ONLY as the block that prevents
  them executing (they cannot authorize a live stage — regression-tested)
- All historical evidence (research/issue-*, closed issues) preserved

Docs updated: classification manifest (RETIRED entries), pipeline registry
(retired-workflows section), lint-baseline shrunk 82→80 S110 / 356→352 BLE001
(deleted files carried lint debt).

Regression: 1129 passed (was 1069 pre-merge — canonical pipeline tests
joined), 0 henxel failures.
2026-09-09 11:25:42 +01:00

63 lines
4.7 KiB
Markdown

# ResearchProcess code classification manifest (RP2/#265)
Doctrine: detection may be aggressive; deletion must be conservative.
This manifest classifies every research-execution code path. **RP11/#274 EXECUTED 2026-09-09** — RP10 proven (PR #279 merged); safe paths retired:
`research_backend.py` (run_full_research self-walk + --watch), `run_research_stage.py`,
`run_agent_stage.py` (+ its test), the three legacy research workflows, and the
split-stage prompt templates. Retired stage names remain ONLY inside the
RETIRED_STAGES guard that blocks them.
Classifications: CURRENT | ADAPT | SUPERSEDED | COMPATIBILITY | TEST_FIXTURE | DEBUG_ONLY | UNKNOWN_PURPOSE
## Canonical execution path (CURRENT)
| Path | Role | Notes |
|---|---|---|
| `scripts/research_task_tree.py` | canonical stage model | ISSUE→INWARD→OUTWARD→APPLICABILITY→(INNOVATION)→ADVERSARIAL→SYNTHESIS→QUALIFY; RETIRED_STAGES guard; conditional INNOVATION routing |
| `scripts/research_stage_executor.py` | one-stage executor | stage-trigger boundary, idempotency, placement gate wired into execute() |
| `scripts/research_define.py` | ISSUE gate compiler | deterministic, needs_mimo hardwired False (compat shim) |
| `scripts/research_inward_context.py` | INWARD context builder | deterministic + bounded MiMo flag |
| `scripts/research_prompt_compiler.py` | stage prompt compiler | canonical templates incl. issue.md, applicability.md |
| `scripts/research_event_relay.py` | event streaming | ResearchEventRelay, tool receipts |
| `scripts/research_artifact.py` | artifact validation | structured-artifact gate |
| `scripts/research_router.py` | OUTWARD routing | academic/software/web classification |
| `scripts/runner_evidence.py` | placement evidence | runtime hostname/runner capture + Pi rejection gate |
| `scripts/fake_worker.py` | TEST_FIXTURE | deterministic pipeline tests |
| `prompts/research-stages/*.md` | stage templates | issue.md + applicability.md added RP2 |
## SUPERSEDED (retire in RP11 after RP10 proof; DO NOT DELETE NOW)
| Path | Superseded by | Classification | Evidence |
|---|---|---|---|
| `scripts/research_backend.py::run_full_research()` | one-stage-per-StageReady executor | RETIRED 2026-09-09 (self-walking loop, §26.6) | `while stage_count < max_stages` local advance loop; called by `--issue` CLI path and `--watch` loop |
| `scripts/research_backend.py --watch` | Gitea-authorized StageReady events | RETIRED 2026-09-09 (poll-loop supervisor, §26.7) | `while True: gitea_api(...); time.sleep(POLL_INTERVAL)` — deterministic reconciliation only, but watches+launches whole processes rather than single stages |
| `scripts/run_research_stage.py` | `research_stage_executor.py` | ADAPT → verify before RP3 | single ref from one workflow |
| `scripts/run_agent_stage.py` | unified OUTWARD executor | UNKNOWN_PURPOSE | only self-referential test found; investigate in RP11 |
| old stage names `DEFINE`/`OUTWARD_DISCOVERY`/`OUTWARD_READING` | ISSUE / unified OUTWARD | COMPATIBILITY (executor returns RETIRED_STAGE; advance raises) | cannot become READY through canonical path — regression-tested |
| `prompts/research-stages/outward_discovery.md`, `outward_reading.md`, `define.md` | outward.md, issue.md | COMPATIBILITY (not routed by canonical compiler for new runs) | verify no dynamic selection in RP11 |
| `.gitea/workflows/research-dispatcher.yml`, `research-stage-headless.yml` dispatch semantics | StageReady → desktop executor | ADAPT | runs-on: rune-ci-desktop already correct; stage input default `DEFINE` must move to `ISSUE` |
## Issues classified as disposable acceptance history (26.8)
- #245, #254, #255, #256, #260, #261, #262: `research-pending` trigger labels
removed 2026-09-08 (RP0) — no stale process can redispatch.
- #263: closed+superseded with evidence note; artifacts preserved at
`/mnt/workdrive/research-stage/research/issue-263/`.
## tui-restart-pending (legacy permission/restart mechanism)
Classification: **SUPERSEDED CANDIDATE** (not removed).
The pending restart procedure existed to fix permission flags for the OLD
research dispatch flow. The corrected canonical path does not depend on it.
Verify before RP11 removal that no current hook still reads the flag file.
## RP11 acceptance checklist (carried forward from handoff §26.11)
- one canonical authority per responsibility (stage model, StageReady,
execution, eligibility, artifact schema, gate, persistence, TUI
projection, runner placement, refinement routing)
- no production self-walking loop; no foreground sleep/poll supervisor
- no heavy-cognition path targeting the Pi
- old stage names cannot become READY (already proven: test_retired_stages_cannot_become_ready)
- one real progression issue still completes after cleanup