Section-reshift / serve-next plan_corpus primitive
Goal
Build the ABSENT section-level reshift primitive. Sections serve in lexorank key order and no primitive re-keys a section to be served next; move_work_item re-keys work_items only. This section delivers reshift_section_to_next + the linear-forward work-item reshift under flock + CAS, preserving the linear-DAG.
Implementation sketch
New primitive in scripts/plan_corpus/ (sibling to work_item_status.move_work_item). reshift_section_to_next re-keys via lexorank under fcntl.flock + content_hash.compute_full_section_hash CAS. After every re-key, run linear_dag.enforce_linear_dag and reject diamonds/branches. Work-item linear-forward reshift relocates/supersedes the stuck grind work_item.
Spec references
scripts/plan_corpus/work_item_status.py:move_work_item (work_item re-key precedent); scripts/plan_corpus/linear_dag.py:enforce_linear_dag (INV-19/20); scripts/plan_corpus/content_hash.py:compute_full_section_hash (CAS); state-discipline.md §4 (atomic-flip discipline).
Work Items
-
Implement a section-level reshift primitive in
scripts/plan_corpus/(the ABSENT capability —work_item_status.move_work_itemre-keys work_items only).reshift_section_to_next(plan_json_path, section_id, *, expected_read_base_hash=None, ...)re-keys the target section vialexoranksoserve_next_v7serves it next, underfcntl.flock+ optimistic-concurrency CAS (compute_full_section_hash) mirroringwork_item_statusdiscipline. -
Implement the linear-forward work-item reshift: relocate (or supersede) the stuck grind work_item so the walk advances to the new forward section, preserving the INV-19/INV-20 linear-DAG. Re-run
scripts/plan_corpus/linear_dag.py(enforce_linear_dag) after every re-key; REJECT any diamond/branch introduced by the reshift. -
Author pytest coverage: after
reshift_section_to_next,serve_next_v7returns the new section;linear_daggate passes; CAS refuses on a stale read-base; plan.json stays script-only (no markdown checkbox introduced). Tests precede implementation.
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “grind-exhaustion-forward-escalation/s-9359765d” }, “generated_at”: “2026-06-19T16:58:39.209435+00:00”, “graph_state”: { “head_sha”: “357fe4d2”, “last_code_import_at”: “2026-06-19T16:54:25.866Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:grind-exhaustion-forward-escalation/s-9359765d] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/grind-exhaustion-forward-escalation” } } }
(full dossier: section-reshift-serve-next-primitive—s-9359765d.intel.json)