feat(research): migrate approval queue end-to-end #155

Merged
lost-rob0t merged 3 commits from feat/research-approval-migration into main 2026-08-27 13:16:16 +00:00
lost-rob0t commented 2026-08-27 12:45:15 +00:00 (Migrated from github.com)

Summary

This PR makes /research-pending a canonical operator queue and adds fail-closed regression gates. It does not merge or deploy anything.

Pre-Migration Inventory

  • Scope: roam/research/**/*.org, excluding index.org, sources.org, and search-log.org, exactly the scope consumed by the repository queue.
  • Total eligible research records scanned: 91.
  • Canonical records before migration: 0.
  • Proposed records needing migration: 91.
  • Lifecycle counts: APPROVED=15, DONE=12, DRAFT=4, IMPLEMENTED-PROTOTYPE=4, MISSING=2, RESEARCHING=3, REVIEW=50, SUPERSEDED=1.
  • Inferred approval counts: APPROVED=29, PENDING=62, REJECTED=0.
  • Already canonical before migration: none.
  • Ambiguous records: roam/research/auto-dig/ADAR-APPROVAL-001-dashboard-ux.org was handled as PENDING; its old approval evidence authorizes a linked design/implementation direction, not a research conclusion, and the canonical evidence records that ambiguity. Its DONE lifecycle was preserved.

Migration Result

  • Eligible records migrated: 91.
  • Canonical records after migration: 91.
  • Final approval totals: PENDING=62, APPROVED=29, REJECTED=0.
  • Final lifecycle counts are unchanged from the inventory above.
  • Zero unmigrated REVIEW/RESEARCHED/VERIFIED records remain in the eligible scope.
  • All 91 records carry the seven canonical fields under prolog-rlm.research-approval.v1, immediately after #+status:.
  • Research bodies and lifecycle keywords were verified byte-for-byte against each recorded pre-migration Git blob.
  • APPROVED mappings require explicit research-basis/scope/direction/conclusion evidence or a strict legacy human approval record. Publication, implementation, architecture, and design-promotion approvals do not promote research approval.

Queue And PR Pane

  • /research-pending now renders 62 canonical pending rows by default; no legacy toggle is required.
  • Repository and project columns are visible; the generated queue includes lost-rob0t/starintel-auto-research with auto-dig, auto-research, star-server, and the other corpus projects.
  • Lifecycle and approval filters remain independent.
  • PR discovery accepts an exact standalone <!-- starintel-research-approval:v1 --> body line, the research-approval/... branch convention, or strict legacy review conventions.
  • Arbitrary occurrences of research or ADARD no longer qualify a PR.
  • The Emacs producer change is in separate dotfiles PR #161: https://github.com/lost-rob0t/dotfiles/pull/161

False Positives Excluded

  • lost-rob0t/dotfiles#156 feat(qtile): add shared Emacs popup UI and stabilize desktop integration is excluded.
  • lost-rob0t/prolog-rlm#132 Add programmable AgentProlog configuration runtime is excluded.
  • lost-rob0t/starintel-server#126 test: re-prove strict trailing-comma rejection on current master is excluded.
  • lost-rob0t/dotfiles#161 is a producer/configuration PR; its marker appears as documentation in backticks rather than as the exact standalone marker line, so it is excluded from the approval queue.

Correctly Retained

  • lost-rob0t/starintel-auto-research#152 is retained by the strict legacy ## Human-gated ADARD review package convention.
  • lost-rob0t/starintel-auto-research#142 is retained by the strict research/ branch plus roam/research/*.org body-path convention.
  • A newly generated approval-only PR is retained when its body contains the exact standalone marker line; this is covered by the browser classifier regression and dotfiles ERT regression.

Files Changed

  • 91 existing roam/research/**/*.org records: canonical approval metadata only; no design, ADR, index, runbook, todo, or ordinary project note was migrated.
  • scripts/research_approval_migration.py: deterministic report, dry-run, migration, check, normalization, provenance verification, legacy evidence reconciliation, and fail-closed contradiction handling.
  • scripts/research_queue.py and scripts/build-research-pending.py: strict canonical queue parsing and visible repository column.
  • pages/static/research-pending.js and tests/test_research_pending.py: explicit marker/branch/legacy PR classifier and false-positive regressions.
  • tests/test_research_approval_migration.py: migration mapping, body/lifecycle preservation, contradiction, discovery, and idempotence regressions.
  • scripts/validate-docs.py: canonical approval metadata validation and metadata-only migration handling for changed-document audits.
  • .github/workflows/pages.yml: migration/provenance gate and generated queue assertions.
  • AGENTS.md and README.md: operator/model guardrails and reproducible migration workflow.

Exact Verification

  • python3 -m py_compile scripts/_roamlib.py scripts/implement.py scripts/mark-design.py scripts/sync.py scripts/validate-docs.py scripts/enhance-pages.py scripts/check-pages-links.py scripts/research_approval_migration.py scripts/research_queue.py scripts/build-research-pending.py: passed.
  • node --check pages/static/research-pending.js: passed.
  • python3 -m unittest discover -s tests -p 'test_*.py' -v: 63 tests passed.
  • python3 scripts/research_approval_migration.py --dry-run: 91 eligible, 91 canonical, 0 proposed changes, APPROVED=29, PENDING=62, REJECTED=0.
  • python3 scripts/research_approval_migration.py: second migration pass completed with migrated=0.
  • python3 scripts/research_approval_migration.py --check --verify: unmigrated=0, lifecycle_preserved=91, body_preserved=91.
  • python3 scripts/validate-changed-docs.py --changed-since origin/main --audit-date 2026-08-27: passed for 91 changed substantive Org documents.
  • python3 scripts/sync.py: synchronized 0 status events.
  • PATH=/tmp/opencode/bin:$PATH bash scripts/publish-pages: passed; 190 Org-roam pages published locally, 61 PlantUML blocks rendered, 168 search records, 100 RSS items, research-pending present.
  • python3 scripts/check-pages-links.py _site: passed for 196 HTML pages and 212 generated text files; links, custom domain, and secret scan passed.
  • CI-equivalent generated queue guard: passed with canonical_rows=62 legacy_rows=0.
  • Dotfiles emacs -Q --batch -L .doom.d/autoload -l .doom.d/tests/research-dashboard-test.el -f ert-run-tests-batch-and-exit: 20 tests passed on dotfiles PR #161.

Known Repository Baseline Failure

  • python3 scripts/sync.py --check and python3 scripts/validate-docs.py were executed exactly and report the repository's existing 248 document-audit violations outside this migration, primarily missing approval/changelog metadata in legacy design/index/runbook/todo documents and pre-existing malformed records. The migration does not suppress those full-audit failures; the changed-document gate passes for this PR's 91 metadata-only research changes.

Exact Head

  • Tested Auto-Research head: ad4f92ae7c4ebd0365c808e25d1288bb5a7fdc7e.
  • Target branch: main.
  • No merge, auto-merge, or publication deployment was performed.
## Summary This PR makes `/research-pending` a canonical operator queue and adds fail-closed regression gates. It does not merge or deploy anything. ## Pre-Migration Inventory - Scope: `roam/research/**/*.org`, excluding `index.org`, `sources.org`, and `search-log.org`, exactly the scope consumed by the repository queue. - Total eligible research records scanned: 91. - Canonical records before migration: 0. - Proposed records needing migration: 91. - Lifecycle counts: `APPROVED=15`, `DONE=12`, `DRAFT=4`, `IMPLEMENTED-PROTOTYPE=4`, `MISSING=2`, `RESEARCHING=3`, `REVIEW=50`, `SUPERSEDED=1`. - Inferred approval counts: `APPROVED=29`, `PENDING=62`, `REJECTED=0`. - Already canonical before migration: none. - Ambiguous records: `roam/research/auto-dig/ADAR-APPROVAL-001-dashboard-ux.org` was handled as `PENDING`; its old approval evidence authorizes a linked design/implementation direction, not a research conclusion, and the canonical evidence records that ambiguity. Its `DONE` lifecycle was preserved. ## Migration Result - Eligible records migrated: 91. - Canonical records after migration: 91. - Final approval totals: `PENDING=62`, `APPROVED=29`, `REJECTED=0`. - Final lifecycle counts are unchanged from the inventory above. - Zero unmigrated `REVIEW`/`RESEARCHED`/`VERIFIED` records remain in the eligible scope. - All 91 records carry the seven canonical fields under `prolog-rlm.research-approval.v1`, immediately after `#+status:`. - Research bodies and lifecycle keywords were verified byte-for-byte against each recorded pre-migration Git blob. - `APPROVED` mappings require explicit research-basis/scope/direction/conclusion evidence or a strict legacy human approval record. Publication, implementation, architecture, and design-promotion approvals do not promote research approval. ## Queue And PR Pane - `/research-pending` now renders 62 canonical pending rows by default; no legacy toggle is required. - Repository and project columns are visible; the generated queue includes `lost-rob0t/starintel-auto-research` with `auto-dig`, `auto-research`, `star-server`, and the other corpus projects. - Lifecycle and approval filters remain independent. - PR discovery accepts an exact standalone `<!-- starintel-research-approval:v1 -->` body line, the `research-approval/...` branch convention, or strict legacy review conventions. - Arbitrary occurrences of `research` or `ADARD` no longer qualify a PR. - The Emacs producer change is in separate dotfiles PR #161: https://github.com/lost-rob0t/dotfiles/pull/161 ## False Positives Excluded - `lost-rob0t/dotfiles#156` `feat(qtile): add shared Emacs popup UI and stabilize desktop integration` is excluded. - `lost-rob0t/prolog-rlm#132` `Add programmable AgentProlog configuration runtime` is excluded. - `lost-rob0t/starintel-server#126` `test: re-prove strict trailing-comma rejection on current master` is excluded. - `lost-rob0t/dotfiles#161` is a producer/configuration PR; its marker appears as documentation in backticks rather than as the exact standalone marker line, so it is excluded from the approval queue. ## Correctly Retained - `lost-rob0t/starintel-auto-research#152` is retained by the strict legacy `## Human-gated ADARD review package` convention. - `lost-rob0t/starintel-auto-research#142` is retained by the strict `research/` branch plus `roam/research/*.org` body-path convention. - A newly generated approval-only PR is retained when its body contains the exact standalone marker line; this is covered by the browser classifier regression and dotfiles ERT regression. ## Files Changed - 91 existing `roam/research/**/*.org` records: canonical approval metadata only; no design, ADR, index, runbook, todo, or ordinary project note was migrated. - `scripts/research_approval_migration.py`: deterministic report, dry-run, migration, check, normalization, provenance verification, legacy evidence reconciliation, and fail-closed contradiction handling. - `scripts/research_queue.py` and `scripts/build-research-pending.py`: strict canonical queue parsing and visible repository column. - `pages/static/research-pending.js` and `tests/test_research_pending.py`: explicit marker/branch/legacy PR classifier and false-positive regressions. - `tests/test_research_approval_migration.py`: migration mapping, body/lifecycle preservation, contradiction, discovery, and idempotence regressions. - `scripts/validate-docs.py`: canonical approval metadata validation and metadata-only migration handling for changed-document audits. - `.github/workflows/pages.yml`: migration/provenance gate and generated queue assertions. - `AGENTS.md` and `README.md`: operator/model guardrails and reproducible migration workflow. ## Exact Verification - `python3 -m py_compile scripts/_roamlib.py scripts/implement.py scripts/mark-design.py scripts/sync.py scripts/validate-docs.py scripts/enhance-pages.py scripts/check-pages-links.py scripts/research_approval_migration.py scripts/research_queue.py scripts/build-research-pending.py`: passed. - `node --check pages/static/research-pending.js`: passed. - `python3 -m unittest discover -s tests -p 'test_*.py' -v`: 63 tests passed. - `python3 scripts/research_approval_migration.py --dry-run`: 91 eligible, 91 canonical, 0 proposed changes, `APPROVED=29`, `PENDING=62`, `REJECTED=0`. - `python3 scripts/research_approval_migration.py`: second migration pass completed with `migrated=0`. - `python3 scripts/research_approval_migration.py --check --verify`: `unmigrated=0`, `lifecycle_preserved=91`, `body_preserved=91`. - `python3 scripts/validate-changed-docs.py --changed-since origin/main --audit-date 2026-08-27`: passed for 91 changed substantive Org documents. - `python3 scripts/sync.py`: synchronized 0 status events. - `PATH=/tmp/opencode/bin:$PATH bash scripts/publish-pages`: passed; 190 Org-roam pages published locally, 61 PlantUML blocks rendered, 168 search records, 100 RSS items, research-pending present. - `python3 scripts/check-pages-links.py _site`: passed for 196 HTML pages and 212 generated text files; links, custom domain, and secret scan passed. - CI-equivalent generated queue guard: passed with `canonical_rows=62 legacy_rows=0`. - Dotfiles `emacs -Q --batch -L .doom.d/autoload -l .doom.d/tests/research-dashboard-test.el -f ert-run-tests-batch-and-exit`: 20 tests passed on dotfiles PR #161. ## Known Repository Baseline Failure - `python3 scripts/sync.py --check` and `python3 scripts/validate-docs.py` were executed exactly and report the repository's existing 248 document-audit violations outside this migration, primarily missing approval/changelog metadata in legacy design/index/runbook/todo documents and pre-existing malformed records. The migration does not suppress those full-audit failures; the changed-document gate passes for this PR's 91 metadata-only research changes. ## Exact Head - Tested Auto-Research head: `ad4f92ae7c4ebd0365c808e25d1288bb5a7fdc7e`. - Target branch: `main`. - No merge, auto-merge, or publication deployment was performed.
lost-rob0t commented 2026-08-27 12:53:35 +00:00 (Migrated from github.com)

Operator naming correction: the Auto-Research approval schema/control-plane namespace must use ADARD naming. Replace prolog-rlm.research-approval.v1 with adard.research-approval.v1 consistently across the migration script, validators, tests, AGENTS/README documentation, and all migrated research metadata before this PR is merged. Prolog-RLM is not the owner/name of this control plane. Preserve the existing lifecycle-vs-approval semantics and rerun the repository-native migration/verification/publication gates after the rename. Do not merge #155 with the Prolog-RLM identifier still present.

Operator naming correction: the Auto-Research approval schema/control-plane namespace must use ADARD naming. Replace `prolog-rlm.research-approval.v1` with `adard.research-approval.v1` consistently across the migration script, validators, tests, AGENTS/README documentation, and all migrated research metadata before this PR is merged. Prolog-RLM is not the owner/name of this control plane. Preserve the existing lifecycle-vs-approval semantics and rerun the repository-native migration/verification/publication gates after the rename. Do not merge #155 with the Prolog-RLM identifier still present.
Sign in to join this conversation.
No description provided.