From aba3680b5ed075e2c4df6edf263e22f432cb5513 Mon Sep 17 00:00:00 2001 From: Andyduck-ops Date: Thu, 20 Aug 2026 10:31:13 +0800 Subject: [PATCH] feat: promote lab workflow library and retire learn surface --- .agents/skills/omp-flow-check/SKILL.md | 29 +- .agents/skills/omp-flow-execute/SKILL.md | 27 +- .agents/skills/omp-flow-learn/SKILL.md | 127 ----- .../omp-flow-workflow-maintainer/SKILL.md | 36 ++ .agents/skills/omp-flow/SKILL.md | 16 +- .claude/skills/omp-flow-check/SKILL.md | 29 +- .claude/skills/omp-flow-execute/SKILL.md | 27 +- .claude/skills/omp-flow-learn/SKILL.md | 127 ----- .../omp-flow-workflow-maintainer/SKILL.md | 36 ++ .claude/skills/omp-flow/SKILL.md | 16 +- .omp/skills/omp-flow-check/SKILL.md | 29 +- .omp/skills/omp-flow-execute/SKILL.md | 27 +- .omp/skills/omp-flow-learn/SKILL.md | 127 ----- .../omp-flow-workflow-maintainer/SKILL.md | 36 ++ .omp/skills/omp-flow/SKILL.md | 16 +- package-lock.json | 4 +- package.json | 2 +- src/cli/init.ts | 24 +- templates/.omp-flow/learn/daily/index.md | 15 - templates/.omp-flow/learn/index.md | 43 -- .../.omp-flow/learn/retrospectives/index.md | 16 - templates/.omp-flow/learn/threads/index.md | 15 - .../.omp-flow/scripts/common/active_task.py | 9 +- .../.omp-flow/scripts/common/task_store.py | 6 +- templates/.omp-flow/scripts/omp_flow.py | 13 +- templates/.omp-flow/workflow.md | 10 +- templates/.omp-flow/workflow/experiment.md | 38 ++ templates/.omp-flow/workflow/full-delivery.md | 300 +++++++++++ templates/.omp-flow/workflow/index.md | 23 + templates/.omp-flow/workflow/lite.md | 32 ++ templates/.omp-flow/workflow/research.md | 35 ++ .../workflow/workflow-maintenance.md | 38 ++ .../common/skills/omp-flow-check/SKILL.md | 29 +- .../common/skills/omp-flow-execute/SKILL.md | 27 +- .../common/skills/omp-flow-learn/SKILL.md | 127 ----- .../omp-flow-workflow-maintainer/SKILL.md | 36 ++ templates/common/skills/omp-flow/SKILL.md | 16 +- tests/learn.test.ts | 484 ------------------ tests/omp-flow.test.ts | 75 ++- 39 files changed, 925 insertions(+), 1197 deletions(-) delete mode 100644 .agents/skills/omp-flow-learn/SKILL.md create mode 100644 .agents/skills/omp-flow-workflow-maintainer/SKILL.md delete mode 100644 .claude/skills/omp-flow-learn/SKILL.md create mode 100644 .claude/skills/omp-flow-workflow-maintainer/SKILL.md delete mode 100644 .omp/skills/omp-flow-learn/SKILL.md create mode 100644 .omp/skills/omp-flow-workflow-maintainer/SKILL.md delete mode 100644 templates/.omp-flow/learn/daily/index.md delete mode 100644 templates/.omp-flow/learn/index.md delete mode 100644 templates/.omp-flow/learn/retrospectives/index.md delete mode 100644 templates/.omp-flow/learn/threads/index.md create mode 100644 templates/.omp-flow/workflow/experiment.md create mode 100644 templates/.omp-flow/workflow/full-delivery.md create mode 100644 templates/.omp-flow/workflow/index.md create mode 100644 templates/.omp-flow/workflow/lite.md create mode 100644 templates/.omp-flow/workflow/research.md create mode 100644 templates/.omp-flow/workflow/workflow-maintenance.md delete mode 100644 templates/common/skills/omp-flow-learn/SKILL.md create mode 100644 templates/common/skills/omp-flow-workflow-maintainer/SKILL.md delete mode 100644 tests/learn.test.ts diff --git a/.agents/skills/omp-flow-check/SKILL.md b/.agents/skills/omp-flow-check/SKILL.md index 8bccef4a..6bf1c8e4 100644 --- a/.agents/skills/omp-flow-check/SKILL.md +++ b/.agents/skills/omp-flow-check/SKILL.md @@ -36,10 +36,33 @@ substitute for the practice result. 4. Verify applicable linked decisions, interfaces, and source constraints. 5. Run independent focused tests and broaden checks for shared behavior or contracts. 6. Write the Review Concept at the supplied output path, link it to the work and handoff, lead - with severity-ordered findings, and record exact commands/results. + with severity-ordered findings, give every finding all applicable `HARD_BLOCKER`, + `PRINCIPAL_BLOCKER`, `WORK_FAIL`, and `ADVISORY` labels, and record exact commands/results. -PASS requires zero failed tests, no unresolved blocking finding, and full scope satisfaction. A -substantive finding returns FAIL to the owning work; do not repair it and approve your own change. +The bounded Work may be `PASS` only when all of these hold: + +- its own authored acceptance criteria are satisfied; +- the linked principal product checkpoint is not blocked, and any required principal-checkpoint + linkage is present; +- every test that exercises the Work's acceptance criteria or the linked principal checkpoint + passes. + +A finding that violates a non-negotiable boundary is `HARD_BLOCKER`; one that concretely prevents +the linked principal checkpoint is `PRINCIPAL_BLOCKER`. A failed Work acceptance criterion or test +exercising it is `WORK_FAIL`, and labels may overlap. If the failed Work is required for the next +principal checkpoint, it is also `PRINCIPAL_BLOCKER`. Any `HARD_BLOCKER`, `PRINCIPAL_BLOCKER`, or +`WORK_FAIL` makes the bounded Work `FAIL`; only `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the +principal path. A `WORK_FAIL` without either stronger label enters the recorded owning-Work +backlog. When the principal checkpoint produces `continue`, `narrow`, or `stop`, that backlog +requires explicit human/design routing for repair, deferral, removal, narrowing, or stop; it does +not autonomously create repair/review work or preempt the principal queue. + +A failed test may be `ADVISORY` only when the reviewer records evidence that it is unrelated to +the Work acceptance and principal checkpoint, pre-existing, and separately attributable, with the +exact command and result. Missing or ambiguous attribution is not a basis for `PASS`. +`ADVISORY` findings remain explicit residual risk but do not make the Work `FAIL`, reopen accepted +Work, or preempt the principal checkpoint. `PASS` may carry only those explicitly attributed +unrelated red tests and other advisory findings. ## Red Flags diff --git a/.agents/skills/omp-flow-execute/SKILL.md b/.agents/skills/omp-flow-execute/SKILL.md index 7cfcee23..b85e222c 100644 --- a/.agents/skills/omp-flow-execute/SKILL.md +++ b/.agents/skills/omp-flow-execute/SKILL.md @@ -36,8 +36,23 @@ description: Coordinate native implementation and independent review from approv runs independent checks, and writes the promised Review Concept. 5. Finish with the same reviewer actor ID. Read the review's findings and verdict as knowledge; Python does not parse or duplicate them into Evidence or row status. -6. A substantive failure returns to the owning work/design Concept for repair and another - independent review. Material design changes repeat the applicable QbD decision. +6. Classify every finding with all applicable labels: + - `HARD_BLOCKER` violates a non-negotiable safety, authority, identity, integrity, + assignment/receipt/source-binding, or irreversible-effect boundary; + - `PRINCIPAL_BLOCKER` concretely prevents the next authored principal product checkpoint; + - `WORK_FAIL` violates the bounded Work's own acceptance criteria or a test that exercises + them; it may overlap either stronger label; + - `ADVISORY` is any other recorded quality, robustness, completeness, or elegance risk. + A failed prerequisite Work required by the next principal checkpoint is also + `PRINCIPAL_BLOCKER`. `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the principal path and + return to the owning work/design Concept for explicit routing. `WORK_FAIL` makes that Work + `FAIL` and enters a recorded owning-Work backlog; absent a hard/principal label it must not + autonomously create repair/review work, reopen accepted Work, or preempt the principal + checkpoint. `ADVISORY` remains recorded residual risk and has none of those effects. +7. A hard/principal failure requires explicit human/design routing. When the principal checkpoint + produces `continue`, `narrow`, or `stop`, present every recorded `WORK_FAIL` backlog to the + human/design decision for explicit repair, deferral, removal, narrowing, or stop; none of those + routes is autonomous. Material design changes repeat the applicable QbD decision. For native batch execution, repeat `operation start` for every item. Preserve each independent `(id = actorId, role, assignment)` tuple; never share an operation, assignment, actor ID, receipt, @@ -45,9 +60,11 @@ or rewritten prompt across items. ## Completion -Continue without asking "should I continue?" until the accepted work has linked independent -reviews, a real blocker needs user input, or design/work must return through a gate. Then load -`omp-flow-finish`. +Continue through the authored work order toward the next principal product acceptance checkpoint. +Do not let `WORK_FAIL` backlog or `ADVISORY` findings preempt that checkpoint. Stop autonomous +continuation when a `HARD_BLOCKER` or `PRINCIPAL_BLOCKER` needs a human/design decision or when +the principal checkpoint has produced its declared continue/narrow/stop evidence; do not +manufacture completion by clearing every secondary finding. ## Red Flags diff --git a/.agents/skills/omp-flow-learn/SKILL.md b/.agents/skills/omp-flow-learn/SKILL.md deleted file mode 100644 index c986e8ca..00000000 --- a/.agents/skills/omp-flow-learn/SKILL.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -name: omp-flow-learn -description: Maintain and use repository-root .omp-flow/learn for deliberate, reciprocal, resumable Human–Agent co-learning when a human is present and pursuing understanding rather than production execution. ---- - -# OMP-Flow Learn - -Use repository-root `.omp-flow/learn/` when a human is actively pursuing mutual understanding, -explanation, challenge, reconsideration, or reflection. Learn is a human-present dialogue in which -both participants may correct their models; autonomous harvesting, passive one-way tutoring, or -summary generation is not a substitute. - -Production work normally pauses during a Learn conversation. Source and code inspection, worked -examples, counterexamples, and discussion remain available, but do not execute production work -until the human returns the conversation to production. - -## Consult and bootstrap - -Open a known Learn Concept directly when its path is available. Otherwise start at -`.omp-flow/learn/index.md` and follow only ordinary links useful to the current discussion. Indexes -support navigation; they are not exhaustive manifests. - -When Learn is genuinely needed and the root is absent, bootstrap only the root index and the -`daily/`, `threads/`, and `retrospectives/` indexes described by the canonical minimal structure. -Do not pre-populate speculative encounters, a taxonomy, or companion records. - -## Preserve a resumable checkpoint - -Use judgment to select or create a bundle immediately below the relevant stable directory. Name a -new bundle `YYYY-MM-DD-/` and maintain its authored `index.md` so a later human and Agent can -recover the useful current understanding, disagreement, correction, or open point. Add only -concrete descriptive Markdown Concepts that make the learning easier to resume or challenge. - -A Daily records a useful dated encounter and may stand alone. A Thread is warranted only when a -topic needs continuity across encounters. A Retrospective is warranted only for a substantive -lesson about understanding or collaboration. Do not manufacture a Thread or Retrospective to -complete a set. - -Treat the human's corrections, rejected premises, values, business context, and objections as -learning material. Make corrected Agent assumptions visible when that helps resumption. Accuracy -comes from reciprocal correction and evidence, not from fluent prose or Agent confidence. - -## Authority and continuity boundaries - -Learn is provisional authored context, not proof of understanding or completion. - -- A Learn artifact cannot advance, pause-state, approve, dispatch, or otherwise alter an omp-flow - Task. A Task link is contextual; commitments remain authored in the applicable Task Bundle. -- A Learn artifact is not Wiki authority and is never promoted automatically. Durable knowledge - reaches `.omp-flow/wiki/` only through ordinary evidence-based Wiki maintenance. -- Cross-session continuity is limited to visible authored artifacts. Never claim a hidden user - profile, persistent personal memory, or model-weight change. - -## Select the smallest useful lens - -The lenses below are a selectable conversational repertoire, not stages, a checklist, a catechism, -an assessment, or an Agent-led teaching script. Choose the smallest lens that addresses the live -misunderstanding. Combine lenses only when one supplies a relevant corrective to another. Concrete -project facts, code, sources, worked cases, and the human's correction outrank philosophical labels. -Stop when the participants have a useful explanation, disagreement, or open point; do not march -through the remaining lenses. - -### Feynman-style self-explanation - -Invite a plain account of one concrete causal link. Find the first hidden term, unsupported leap, or -failed application, then repair it from a source or worked case. Fluency is only a possible gap -diagnostic and never proof of mastery. Do not attribute the modern packaged “Feynman Technique” to -Feynman. - -### Cargo Cult Science integrity - -For a consequential explanation, volunteer the material contrary fact, plausible alternative, -uncertainty, and observation that could change the conclusion so the other participant can judge -it. This is judgment about material disclosure, not four mandatory headings, a fixed response form, -or a ritual inventory of every caveat. - -### Grounded first principles - -Distinguish observed fact, definition, hard constraint, value choice, assumption, and convention. -Trace only premises capable of changing the present conclusion, retain the conditions under which -it should be revised, and stop when further reduction would not help. Existing knowledge and -history are evidence to examine, not impurities to discard. - -### Practice-led principal-contradiction analysis - -Offer the principal contradiction, dominant aspect, and material secondary coupling only as a -revisable prioritization hypothesis tied to current effects. Name the changed condition or practical -observation that would reorder it. Returning to practice may mean sources, code inspection, -examples, counterexamples, a diagram, or later observable verification; it does not authorize -production execution while Learn is paused. Do not import a universal single-cause claim or -political doctrine. - -### Material history or genealogy - -Use a concise temporal account only when it clarifies the present. Connect a concrete problem and -conditions to a prior arrangement, emergence or adoption, limitation, and later change; include a -discontinuity where needed and label interpretive causality. Reject inevitable or present-purpose -origin stories, mechanically economic single-causality, and political doctrine; examine interacting -causes and source support. - -### Reciprocal Socratic questioning - -Use a few genuine reasons, counterexamples, and consequence questions to test either participant's -claim. Either participant may reject a premise, ask the Agent to answer directly, or leave an aporia -open. Questions yield to direct explanation or admitted uncertainty when more useful and never -steer assent toward a conclusion the Agent selected in advance. - -### Minimal structural box-drawing - -Draw labeled ASCII, Unicode, or Mermaid boxes and arrows only when a few elements at one useful -abstraction level make a particular structural inference cheaper than prose. Check the picture -against sources, code, examples, or the participants' model; revise or discard it when it does not -help. A diagram is not inherently clarifying. - -These lenses create optional corrective friction rather than a composite routine: explanation -answers to integrity and evidence; alleged hard constraints to history; principal ranking to -secondary couplings and changed conditions; historical narrative to discontinuity and interacting -causes; questions to reciprocal answerability; and diagrams to prose, source, or practice -comparison. They do not adopt a complete philosophical school or establish mastery. - -## Keep Learn conversational - -Do not introduce an entry command, pause or save signal, fixed encounter stages, required -transcript or summary, mandatory headings, score, metric, completion gate, approval ceremony, or -per-edit human approval rule. There is no parsed body schema, lifecycle record, second task system, -or automatic learning judgment. Preserve only what is genuinely useful for reciprocal resumption, -and return to production only when the human changes the conversation back to production work. diff --git a/.agents/skills/omp-flow-workflow-maintainer/SKILL.md b/.agents/skills/omp-flow-workflow-maintainer/SKILL.md new file mode 100644 index 00000000..2619dea8 --- /dev/null +++ b/.agents/skills/omp-flow-workflow-maintainer/SKILL.md @@ -0,0 +1,36 @@ +--- +name: omp-flow-workflow-maintainer +description: Inspect authored Workflow documents and practice evidence, then write a reviewable maintenance candidate without directly promoting production policy. +--- + +# OMP-Flow Workflow Maintainer + +Use this Skill only for a bounded Workflow Library maintenance Task. The Task Bundle is the source of +purpose, boundaries, evidence, output, and human decisions. + +## Method + +1. Read the Task entry and `.omp-flow/workflow/index.md` when it exists. Follow only useful ordinary + links to the affected Workflow Markdown, authored fragments, archived Task evidence, Reviews, + handoffs, and Sleep Candidates. +2. Separate repository facts, repeated practice findings, contrary evidence, local exceptions, + applicability boundaries, and unresolved questions. +3. Write the smallest candidate revision in the assigned Task output. State the affected Workflow or + fragment, proposed prose change, expected benefit, counterexample, regression risk, and replay or + verification plan. +4. Do not edit canonical production Workflow policy, Skills, Hooks, or Runtime as an automatic result + of this maintenance analysis. Promotion is a separate bounded Work after independent review and + human decision. +5. If a production change is authorized, the Main session creates the bounded Work and uses + `operation start`; forward its complete returned assignment unchanged. Never manufacture an + assignment, actor ID, receipt, dependency, or runtime phase. + +## Boundaries + +- Do not parse Workflow Markdown, folder names, headings, links, or frontmatter into machine state. +- Do not create a graph runtime, route schema, exact-topology identity, second dispatcher, or + automatic Workflow selector. +- Do not let model name alone select Lite or bypass a required boundary. +- Do not turn one Task-specific observation into a global Workflow rule without replay, contrary + evidence, applicability limits, independent review, and human calibration. +- Do not spawn another workflow sub-agent. diff --git a/.agents/skills/omp-flow/SKILL.md b/.agents/skills/omp-flow/SKILL.md index cf4a0889..0b5e1efe 100644 --- a/.agents/skills/omp-flow/SKILL.md +++ b/.agents/skills/omp-flow/SKILL.md @@ -19,16 +19,16 @@ implement work itself, or manufacture missing knowledge. ## Start Here -1. Confirm `.omp-flow/workflow.md` and `.omp-flow/scripts/omp_flow.py` exist. If not, stop and ask - whether to initialize the requested Harness adapter. +1. Confirm `.omp-flow/scripts/omp_flow.py` and at least one Workflow source: + `.omp-flow/workflow/index.md` or legacy `.omp-flow/workflow.md`. A fresh project should use the + index; an existing project may still use the legacy file during migration. If the runtime kernel + or both Workflow sources are missing, stop and ask whether to initialize the requested Harness + adapter. 2. Resolve this session's active task directory through the runtime or select one explicitly. - `task select ` works with a native Harness session or the repository-local terminal - lane. When concurrent callers may share that terminal lane, pass `--task ` to commands - that accept it; an explicit Task always takes precedence over the convenience pointer. Never - borrow another session's active task. + Never borrow another session's active task. 3. Open the Bundle root `index.md`. Follow only links useful to the current request. -4. Read `.omp-flow/workflow.md` when the Bundle or requested operation needs details not present - in this router. +4. Read `.omp-flow/workflow/index.md` when present, then follow its ordinary links to the Workflow + Markdown relevant to this Task. Fall back to `.omp-flow/workflow.md` only for legacy projects. 5. Treat a missing root index or required entry Concept as a blocker. Do not fall back to `task.json`, CSV/JSONL stores, generated context, or chat reconstruction. diff --git a/.claude/skills/omp-flow-check/SKILL.md b/.claude/skills/omp-flow-check/SKILL.md index 8bccef4a..6bf1c8e4 100644 --- a/.claude/skills/omp-flow-check/SKILL.md +++ b/.claude/skills/omp-flow-check/SKILL.md @@ -36,10 +36,33 @@ substitute for the practice result. 4. Verify applicable linked decisions, interfaces, and source constraints. 5. Run independent focused tests and broaden checks for shared behavior or contracts. 6. Write the Review Concept at the supplied output path, link it to the work and handoff, lead - with severity-ordered findings, and record exact commands/results. + with severity-ordered findings, give every finding all applicable `HARD_BLOCKER`, + `PRINCIPAL_BLOCKER`, `WORK_FAIL`, and `ADVISORY` labels, and record exact commands/results. -PASS requires zero failed tests, no unresolved blocking finding, and full scope satisfaction. A -substantive finding returns FAIL to the owning work; do not repair it and approve your own change. +The bounded Work may be `PASS` only when all of these hold: + +- its own authored acceptance criteria are satisfied; +- the linked principal product checkpoint is not blocked, and any required principal-checkpoint + linkage is present; +- every test that exercises the Work's acceptance criteria or the linked principal checkpoint + passes. + +A finding that violates a non-negotiable boundary is `HARD_BLOCKER`; one that concretely prevents +the linked principal checkpoint is `PRINCIPAL_BLOCKER`. A failed Work acceptance criterion or test +exercising it is `WORK_FAIL`, and labels may overlap. If the failed Work is required for the next +principal checkpoint, it is also `PRINCIPAL_BLOCKER`. Any `HARD_BLOCKER`, `PRINCIPAL_BLOCKER`, or +`WORK_FAIL` makes the bounded Work `FAIL`; only `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the +principal path. A `WORK_FAIL` without either stronger label enters the recorded owning-Work +backlog. When the principal checkpoint produces `continue`, `narrow`, or `stop`, that backlog +requires explicit human/design routing for repair, deferral, removal, narrowing, or stop; it does +not autonomously create repair/review work or preempt the principal queue. + +A failed test may be `ADVISORY` only when the reviewer records evidence that it is unrelated to +the Work acceptance and principal checkpoint, pre-existing, and separately attributable, with the +exact command and result. Missing or ambiguous attribution is not a basis for `PASS`. +`ADVISORY` findings remain explicit residual risk but do not make the Work `FAIL`, reopen accepted +Work, or preempt the principal checkpoint. `PASS` may carry only those explicitly attributed +unrelated red tests and other advisory findings. ## Red Flags diff --git a/.claude/skills/omp-flow-execute/SKILL.md b/.claude/skills/omp-flow-execute/SKILL.md index 7cfcee23..b85e222c 100644 --- a/.claude/skills/omp-flow-execute/SKILL.md +++ b/.claude/skills/omp-flow-execute/SKILL.md @@ -36,8 +36,23 @@ description: Coordinate native implementation and independent review from approv runs independent checks, and writes the promised Review Concept. 5. Finish with the same reviewer actor ID. Read the review's findings and verdict as knowledge; Python does not parse or duplicate them into Evidence or row status. -6. A substantive failure returns to the owning work/design Concept for repair and another - independent review. Material design changes repeat the applicable QbD decision. +6. Classify every finding with all applicable labels: + - `HARD_BLOCKER` violates a non-negotiable safety, authority, identity, integrity, + assignment/receipt/source-binding, or irreversible-effect boundary; + - `PRINCIPAL_BLOCKER` concretely prevents the next authored principal product checkpoint; + - `WORK_FAIL` violates the bounded Work's own acceptance criteria or a test that exercises + them; it may overlap either stronger label; + - `ADVISORY` is any other recorded quality, robustness, completeness, or elegance risk. + A failed prerequisite Work required by the next principal checkpoint is also + `PRINCIPAL_BLOCKER`. `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the principal path and + return to the owning work/design Concept for explicit routing. `WORK_FAIL` makes that Work + `FAIL` and enters a recorded owning-Work backlog; absent a hard/principal label it must not + autonomously create repair/review work, reopen accepted Work, or preempt the principal + checkpoint. `ADVISORY` remains recorded residual risk and has none of those effects. +7. A hard/principal failure requires explicit human/design routing. When the principal checkpoint + produces `continue`, `narrow`, or `stop`, present every recorded `WORK_FAIL` backlog to the + human/design decision for explicit repair, deferral, removal, narrowing, or stop; none of those + routes is autonomous. Material design changes repeat the applicable QbD decision. For native batch execution, repeat `operation start` for every item. Preserve each independent `(id = actorId, role, assignment)` tuple; never share an operation, assignment, actor ID, receipt, @@ -45,9 +60,11 @@ or rewritten prompt across items. ## Completion -Continue without asking "should I continue?" until the accepted work has linked independent -reviews, a real blocker needs user input, or design/work must return through a gate. Then load -`omp-flow-finish`. +Continue through the authored work order toward the next principal product acceptance checkpoint. +Do not let `WORK_FAIL` backlog or `ADVISORY` findings preempt that checkpoint. Stop autonomous +continuation when a `HARD_BLOCKER` or `PRINCIPAL_BLOCKER` needs a human/design decision or when +the principal checkpoint has produced its declared continue/narrow/stop evidence; do not +manufacture completion by clearing every secondary finding. ## Red Flags diff --git a/.claude/skills/omp-flow-learn/SKILL.md b/.claude/skills/omp-flow-learn/SKILL.md deleted file mode 100644 index c986e8ca..00000000 --- a/.claude/skills/omp-flow-learn/SKILL.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -name: omp-flow-learn -description: Maintain and use repository-root .omp-flow/learn for deliberate, reciprocal, resumable Human–Agent co-learning when a human is present and pursuing understanding rather than production execution. ---- - -# OMP-Flow Learn - -Use repository-root `.omp-flow/learn/` when a human is actively pursuing mutual understanding, -explanation, challenge, reconsideration, or reflection. Learn is a human-present dialogue in which -both participants may correct their models; autonomous harvesting, passive one-way tutoring, or -summary generation is not a substitute. - -Production work normally pauses during a Learn conversation. Source and code inspection, worked -examples, counterexamples, and discussion remain available, but do not execute production work -until the human returns the conversation to production. - -## Consult and bootstrap - -Open a known Learn Concept directly when its path is available. Otherwise start at -`.omp-flow/learn/index.md` and follow only ordinary links useful to the current discussion. Indexes -support navigation; they are not exhaustive manifests. - -When Learn is genuinely needed and the root is absent, bootstrap only the root index and the -`daily/`, `threads/`, and `retrospectives/` indexes described by the canonical minimal structure. -Do not pre-populate speculative encounters, a taxonomy, or companion records. - -## Preserve a resumable checkpoint - -Use judgment to select or create a bundle immediately below the relevant stable directory. Name a -new bundle `YYYY-MM-DD-/` and maintain its authored `index.md` so a later human and Agent can -recover the useful current understanding, disagreement, correction, or open point. Add only -concrete descriptive Markdown Concepts that make the learning easier to resume or challenge. - -A Daily records a useful dated encounter and may stand alone. A Thread is warranted only when a -topic needs continuity across encounters. A Retrospective is warranted only for a substantive -lesson about understanding or collaboration. Do not manufacture a Thread or Retrospective to -complete a set. - -Treat the human's corrections, rejected premises, values, business context, and objections as -learning material. Make corrected Agent assumptions visible when that helps resumption. Accuracy -comes from reciprocal correction and evidence, not from fluent prose or Agent confidence. - -## Authority and continuity boundaries - -Learn is provisional authored context, not proof of understanding or completion. - -- A Learn artifact cannot advance, pause-state, approve, dispatch, or otherwise alter an omp-flow - Task. A Task link is contextual; commitments remain authored in the applicable Task Bundle. -- A Learn artifact is not Wiki authority and is never promoted automatically. Durable knowledge - reaches `.omp-flow/wiki/` only through ordinary evidence-based Wiki maintenance. -- Cross-session continuity is limited to visible authored artifacts. Never claim a hidden user - profile, persistent personal memory, or model-weight change. - -## Select the smallest useful lens - -The lenses below are a selectable conversational repertoire, not stages, a checklist, a catechism, -an assessment, or an Agent-led teaching script. Choose the smallest lens that addresses the live -misunderstanding. Combine lenses only when one supplies a relevant corrective to another. Concrete -project facts, code, sources, worked cases, and the human's correction outrank philosophical labels. -Stop when the participants have a useful explanation, disagreement, or open point; do not march -through the remaining lenses. - -### Feynman-style self-explanation - -Invite a plain account of one concrete causal link. Find the first hidden term, unsupported leap, or -failed application, then repair it from a source or worked case. Fluency is only a possible gap -diagnostic and never proof of mastery. Do not attribute the modern packaged “Feynman Technique” to -Feynman. - -### Cargo Cult Science integrity - -For a consequential explanation, volunteer the material contrary fact, plausible alternative, -uncertainty, and observation that could change the conclusion so the other participant can judge -it. This is judgment about material disclosure, not four mandatory headings, a fixed response form, -or a ritual inventory of every caveat. - -### Grounded first principles - -Distinguish observed fact, definition, hard constraint, value choice, assumption, and convention. -Trace only premises capable of changing the present conclusion, retain the conditions under which -it should be revised, and stop when further reduction would not help. Existing knowledge and -history are evidence to examine, not impurities to discard. - -### Practice-led principal-contradiction analysis - -Offer the principal contradiction, dominant aspect, and material secondary coupling only as a -revisable prioritization hypothesis tied to current effects. Name the changed condition or practical -observation that would reorder it. Returning to practice may mean sources, code inspection, -examples, counterexamples, a diagram, or later observable verification; it does not authorize -production execution while Learn is paused. Do not import a universal single-cause claim or -political doctrine. - -### Material history or genealogy - -Use a concise temporal account only when it clarifies the present. Connect a concrete problem and -conditions to a prior arrangement, emergence or adoption, limitation, and later change; include a -discontinuity where needed and label interpretive causality. Reject inevitable or present-purpose -origin stories, mechanically economic single-causality, and political doctrine; examine interacting -causes and source support. - -### Reciprocal Socratic questioning - -Use a few genuine reasons, counterexamples, and consequence questions to test either participant's -claim. Either participant may reject a premise, ask the Agent to answer directly, or leave an aporia -open. Questions yield to direct explanation or admitted uncertainty when more useful and never -steer assent toward a conclusion the Agent selected in advance. - -### Minimal structural box-drawing - -Draw labeled ASCII, Unicode, or Mermaid boxes and arrows only when a few elements at one useful -abstraction level make a particular structural inference cheaper than prose. Check the picture -against sources, code, examples, or the participants' model; revise or discard it when it does not -help. A diagram is not inherently clarifying. - -These lenses create optional corrective friction rather than a composite routine: explanation -answers to integrity and evidence; alleged hard constraints to history; principal ranking to -secondary couplings and changed conditions; historical narrative to discontinuity and interacting -causes; questions to reciprocal answerability; and diagrams to prose, source, or practice -comparison. They do not adopt a complete philosophical school or establish mastery. - -## Keep Learn conversational - -Do not introduce an entry command, pause or save signal, fixed encounter stages, required -transcript or summary, mandatory headings, score, metric, completion gate, approval ceremony, or -per-edit human approval rule. There is no parsed body schema, lifecycle record, second task system, -or automatic learning judgment. Preserve only what is genuinely useful for reciprocal resumption, -and return to production only when the human changes the conversation back to production work. diff --git a/.claude/skills/omp-flow-workflow-maintainer/SKILL.md b/.claude/skills/omp-flow-workflow-maintainer/SKILL.md new file mode 100644 index 00000000..2619dea8 --- /dev/null +++ b/.claude/skills/omp-flow-workflow-maintainer/SKILL.md @@ -0,0 +1,36 @@ +--- +name: omp-flow-workflow-maintainer +description: Inspect authored Workflow documents and practice evidence, then write a reviewable maintenance candidate without directly promoting production policy. +--- + +# OMP-Flow Workflow Maintainer + +Use this Skill only for a bounded Workflow Library maintenance Task. The Task Bundle is the source of +purpose, boundaries, evidence, output, and human decisions. + +## Method + +1. Read the Task entry and `.omp-flow/workflow/index.md` when it exists. Follow only useful ordinary + links to the affected Workflow Markdown, authored fragments, archived Task evidence, Reviews, + handoffs, and Sleep Candidates. +2. Separate repository facts, repeated practice findings, contrary evidence, local exceptions, + applicability boundaries, and unresolved questions. +3. Write the smallest candidate revision in the assigned Task output. State the affected Workflow or + fragment, proposed prose change, expected benefit, counterexample, regression risk, and replay or + verification plan. +4. Do not edit canonical production Workflow policy, Skills, Hooks, or Runtime as an automatic result + of this maintenance analysis. Promotion is a separate bounded Work after independent review and + human decision. +5. If a production change is authorized, the Main session creates the bounded Work and uses + `operation start`; forward its complete returned assignment unchanged. Never manufacture an + assignment, actor ID, receipt, dependency, or runtime phase. + +## Boundaries + +- Do not parse Workflow Markdown, folder names, headings, links, or frontmatter into machine state. +- Do not create a graph runtime, route schema, exact-topology identity, second dispatcher, or + automatic Workflow selector. +- Do not let model name alone select Lite or bypass a required boundary. +- Do not turn one Task-specific observation into a global Workflow rule without replay, contrary + evidence, applicability limits, independent review, and human calibration. +- Do not spawn another workflow sub-agent. diff --git a/.claude/skills/omp-flow/SKILL.md b/.claude/skills/omp-flow/SKILL.md index cf4a0889..0b5e1efe 100644 --- a/.claude/skills/omp-flow/SKILL.md +++ b/.claude/skills/omp-flow/SKILL.md @@ -19,16 +19,16 @@ implement work itself, or manufacture missing knowledge. ## Start Here -1. Confirm `.omp-flow/workflow.md` and `.omp-flow/scripts/omp_flow.py` exist. If not, stop and ask - whether to initialize the requested Harness adapter. +1. Confirm `.omp-flow/scripts/omp_flow.py` and at least one Workflow source: + `.omp-flow/workflow/index.md` or legacy `.omp-flow/workflow.md`. A fresh project should use the + index; an existing project may still use the legacy file during migration. If the runtime kernel + or both Workflow sources are missing, stop and ask whether to initialize the requested Harness + adapter. 2. Resolve this session's active task directory through the runtime or select one explicitly. - `task select ` works with a native Harness session or the repository-local terminal - lane. When concurrent callers may share that terminal lane, pass `--task ` to commands - that accept it; an explicit Task always takes precedence over the convenience pointer. Never - borrow another session's active task. + Never borrow another session's active task. 3. Open the Bundle root `index.md`. Follow only links useful to the current request. -4. Read `.omp-flow/workflow.md` when the Bundle or requested operation needs details not present - in this router. +4. Read `.omp-flow/workflow/index.md` when present, then follow its ordinary links to the Workflow + Markdown relevant to this Task. Fall back to `.omp-flow/workflow.md` only for legacy projects. 5. Treat a missing root index or required entry Concept as a blocker. Do not fall back to `task.json`, CSV/JSONL stores, generated context, or chat reconstruction. diff --git a/.omp/skills/omp-flow-check/SKILL.md b/.omp/skills/omp-flow-check/SKILL.md index 8bccef4a..6bf1c8e4 100644 --- a/.omp/skills/omp-flow-check/SKILL.md +++ b/.omp/skills/omp-flow-check/SKILL.md @@ -36,10 +36,33 @@ substitute for the practice result. 4. Verify applicable linked decisions, interfaces, and source constraints. 5. Run independent focused tests and broaden checks for shared behavior or contracts. 6. Write the Review Concept at the supplied output path, link it to the work and handoff, lead - with severity-ordered findings, and record exact commands/results. + with severity-ordered findings, give every finding all applicable `HARD_BLOCKER`, + `PRINCIPAL_BLOCKER`, `WORK_FAIL`, and `ADVISORY` labels, and record exact commands/results. -PASS requires zero failed tests, no unresolved blocking finding, and full scope satisfaction. A -substantive finding returns FAIL to the owning work; do not repair it and approve your own change. +The bounded Work may be `PASS` only when all of these hold: + +- its own authored acceptance criteria are satisfied; +- the linked principal product checkpoint is not blocked, and any required principal-checkpoint + linkage is present; +- every test that exercises the Work's acceptance criteria or the linked principal checkpoint + passes. + +A finding that violates a non-negotiable boundary is `HARD_BLOCKER`; one that concretely prevents +the linked principal checkpoint is `PRINCIPAL_BLOCKER`. A failed Work acceptance criterion or test +exercising it is `WORK_FAIL`, and labels may overlap. If the failed Work is required for the next +principal checkpoint, it is also `PRINCIPAL_BLOCKER`. Any `HARD_BLOCKER`, `PRINCIPAL_BLOCKER`, or +`WORK_FAIL` makes the bounded Work `FAIL`; only `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the +principal path. A `WORK_FAIL` without either stronger label enters the recorded owning-Work +backlog. When the principal checkpoint produces `continue`, `narrow`, or `stop`, that backlog +requires explicit human/design routing for repair, deferral, removal, narrowing, or stop; it does +not autonomously create repair/review work or preempt the principal queue. + +A failed test may be `ADVISORY` only when the reviewer records evidence that it is unrelated to +the Work acceptance and principal checkpoint, pre-existing, and separately attributable, with the +exact command and result. Missing or ambiguous attribution is not a basis for `PASS`. +`ADVISORY` findings remain explicit residual risk but do not make the Work `FAIL`, reopen accepted +Work, or preempt the principal checkpoint. `PASS` may carry only those explicitly attributed +unrelated red tests and other advisory findings. ## Red Flags diff --git a/.omp/skills/omp-flow-execute/SKILL.md b/.omp/skills/omp-flow-execute/SKILL.md index 7cfcee23..b85e222c 100644 --- a/.omp/skills/omp-flow-execute/SKILL.md +++ b/.omp/skills/omp-flow-execute/SKILL.md @@ -36,8 +36,23 @@ description: Coordinate native implementation and independent review from approv runs independent checks, and writes the promised Review Concept. 5. Finish with the same reviewer actor ID. Read the review's findings and verdict as knowledge; Python does not parse or duplicate them into Evidence or row status. -6. A substantive failure returns to the owning work/design Concept for repair and another - independent review. Material design changes repeat the applicable QbD decision. +6. Classify every finding with all applicable labels: + - `HARD_BLOCKER` violates a non-negotiable safety, authority, identity, integrity, + assignment/receipt/source-binding, or irreversible-effect boundary; + - `PRINCIPAL_BLOCKER` concretely prevents the next authored principal product checkpoint; + - `WORK_FAIL` violates the bounded Work's own acceptance criteria or a test that exercises + them; it may overlap either stronger label; + - `ADVISORY` is any other recorded quality, robustness, completeness, or elegance risk. + A failed prerequisite Work required by the next principal checkpoint is also + `PRINCIPAL_BLOCKER`. `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the principal path and + return to the owning work/design Concept for explicit routing. `WORK_FAIL` makes that Work + `FAIL` and enters a recorded owning-Work backlog; absent a hard/principal label it must not + autonomously create repair/review work, reopen accepted Work, or preempt the principal + checkpoint. `ADVISORY` remains recorded residual risk and has none of those effects. +7. A hard/principal failure requires explicit human/design routing. When the principal checkpoint + produces `continue`, `narrow`, or `stop`, present every recorded `WORK_FAIL` backlog to the + human/design decision for explicit repair, deferral, removal, narrowing, or stop; none of those + routes is autonomous. Material design changes repeat the applicable QbD decision. For native batch execution, repeat `operation start` for every item. Preserve each independent `(id = actorId, role, assignment)` tuple; never share an operation, assignment, actor ID, receipt, @@ -45,9 +60,11 @@ or rewritten prompt across items. ## Completion -Continue without asking "should I continue?" until the accepted work has linked independent -reviews, a real blocker needs user input, or design/work must return through a gate. Then load -`omp-flow-finish`. +Continue through the authored work order toward the next principal product acceptance checkpoint. +Do not let `WORK_FAIL` backlog or `ADVISORY` findings preempt that checkpoint. Stop autonomous +continuation when a `HARD_BLOCKER` or `PRINCIPAL_BLOCKER` needs a human/design decision or when +the principal checkpoint has produced its declared continue/narrow/stop evidence; do not +manufacture completion by clearing every secondary finding. ## Red Flags diff --git a/.omp/skills/omp-flow-learn/SKILL.md b/.omp/skills/omp-flow-learn/SKILL.md deleted file mode 100644 index c986e8ca..00000000 --- a/.omp/skills/omp-flow-learn/SKILL.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -name: omp-flow-learn -description: Maintain and use repository-root .omp-flow/learn for deliberate, reciprocal, resumable Human–Agent co-learning when a human is present and pursuing understanding rather than production execution. ---- - -# OMP-Flow Learn - -Use repository-root `.omp-flow/learn/` when a human is actively pursuing mutual understanding, -explanation, challenge, reconsideration, or reflection. Learn is a human-present dialogue in which -both participants may correct their models; autonomous harvesting, passive one-way tutoring, or -summary generation is not a substitute. - -Production work normally pauses during a Learn conversation. Source and code inspection, worked -examples, counterexamples, and discussion remain available, but do not execute production work -until the human returns the conversation to production. - -## Consult and bootstrap - -Open a known Learn Concept directly when its path is available. Otherwise start at -`.omp-flow/learn/index.md` and follow only ordinary links useful to the current discussion. Indexes -support navigation; they are not exhaustive manifests. - -When Learn is genuinely needed and the root is absent, bootstrap only the root index and the -`daily/`, `threads/`, and `retrospectives/` indexes described by the canonical minimal structure. -Do not pre-populate speculative encounters, a taxonomy, or companion records. - -## Preserve a resumable checkpoint - -Use judgment to select or create a bundle immediately below the relevant stable directory. Name a -new bundle `YYYY-MM-DD-/` and maintain its authored `index.md` so a later human and Agent can -recover the useful current understanding, disagreement, correction, or open point. Add only -concrete descriptive Markdown Concepts that make the learning easier to resume or challenge. - -A Daily records a useful dated encounter and may stand alone. A Thread is warranted only when a -topic needs continuity across encounters. A Retrospective is warranted only for a substantive -lesson about understanding or collaboration. Do not manufacture a Thread or Retrospective to -complete a set. - -Treat the human's corrections, rejected premises, values, business context, and objections as -learning material. Make corrected Agent assumptions visible when that helps resumption. Accuracy -comes from reciprocal correction and evidence, not from fluent prose or Agent confidence. - -## Authority and continuity boundaries - -Learn is provisional authored context, not proof of understanding or completion. - -- A Learn artifact cannot advance, pause-state, approve, dispatch, or otherwise alter an omp-flow - Task. A Task link is contextual; commitments remain authored in the applicable Task Bundle. -- A Learn artifact is not Wiki authority and is never promoted automatically. Durable knowledge - reaches `.omp-flow/wiki/` only through ordinary evidence-based Wiki maintenance. -- Cross-session continuity is limited to visible authored artifacts. Never claim a hidden user - profile, persistent personal memory, or model-weight change. - -## Select the smallest useful lens - -The lenses below are a selectable conversational repertoire, not stages, a checklist, a catechism, -an assessment, or an Agent-led teaching script. Choose the smallest lens that addresses the live -misunderstanding. Combine lenses only when one supplies a relevant corrective to another. Concrete -project facts, code, sources, worked cases, and the human's correction outrank philosophical labels. -Stop when the participants have a useful explanation, disagreement, or open point; do not march -through the remaining lenses. - -### Feynman-style self-explanation - -Invite a plain account of one concrete causal link. Find the first hidden term, unsupported leap, or -failed application, then repair it from a source or worked case. Fluency is only a possible gap -diagnostic and never proof of mastery. Do not attribute the modern packaged “Feynman Technique” to -Feynman. - -### Cargo Cult Science integrity - -For a consequential explanation, volunteer the material contrary fact, plausible alternative, -uncertainty, and observation that could change the conclusion so the other participant can judge -it. This is judgment about material disclosure, not four mandatory headings, a fixed response form, -or a ritual inventory of every caveat. - -### Grounded first principles - -Distinguish observed fact, definition, hard constraint, value choice, assumption, and convention. -Trace only premises capable of changing the present conclusion, retain the conditions under which -it should be revised, and stop when further reduction would not help. Existing knowledge and -history are evidence to examine, not impurities to discard. - -### Practice-led principal-contradiction analysis - -Offer the principal contradiction, dominant aspect, and material secondary coupling only as a -revisable prioritization hypothesis tied to current effects. Name the changed condition or practical -observation that would reorder it. Returning to practice may mean sources, code inspection, -examples, counterexamples, a diagram, or later observable verification; it does not authorize -production execution while Learn is paused. Do not import a universal single-cause claim or -political doctrine. - -### Material history or genealogy - -Use a concise temporal account only when it clarifies the present. Connect a concrete problem and -conditions to a prior arrangement, emergence or adoption, limitation, and later change; include a -discontinuity where needed and label interpretive causality. Reject inevitable or present-purpose -origin stories, mechanically economic single-causality, and political doctrine; examine interacting -causes and source support. - -### Reciprocal Socratic questioning - -Use a few genuine reasons, counterexamples, and consequence questions to test either participant's -claim. Either participant may reject a premise, ask the Agent to answer directly, or leave an aporia -open. Questions yield to direct explanation or admitted uncertainty when more useful and never -steer assent toward a conclusion the Agent selected in advance. - -### Minimal structural box-drawing - -Draw labeled ASCII, Unicode, or Mermaid boxes and arrows only when a few elements at one useful -abstraction level make a particular structural inference cheaper than prose. Check the picture -against sources, code, examples, or the participants' model; revise or discard it when it does not -help. A diagram is not inherently clarifying. - -These lenses create optional corrective friction rather than a composite routine: explanation -answers to integrity and evidence; alleged hard constraints to history; principal ranking to -secondary couplings and changed conditions; historical narrative to discontinuity and interacting -causes; questions to reciprocal answerability; and diagrams to prose, source, or practice -comparison. They do not adopt a complete philosophical school or establish mastery. - -## Keep Learn conversational - -Do not introduce an entry command, pause or save signal, fixed encounter stages, required -transcript or summary, mandatory headings, score, metric, completion gate, approval ceremony, or -per-edit human approval rule. There is no parsed body schema, lifecycle record, second task system, -or automatic learning judgment. Preserve only what is genuinely useful for reciprocal resumption, -and return to production only when the human changes the conversation back to production work. diff --git a/.omp/skills/omp-flow-workflow-maintainer/SKILL.md b/.omp/skills/omp-flow-workflow-maintainer/SKILL.md new file mode 100644 index 00000000..2619dea8 --- /dev/null +++ b/.omp/skills/omp-flow-workflow-maintainer/SKILL.md @@ -0,0 +1,36 @@ +--- +name: omp-flow-workflow-maintainer +description: Inspect authored Workflow documents and practice evidence, then write a reviewable maintenance candidate without directly promoting production policy. +--- + +# OMP-Flow Workflow Maintainer + +Use this Skill only for a bounded Workflow Library maintenance Task. The Task Bundle is the source of +purpose, boundaries, evidence, output, and human decisions. + +## Method + +1. Read the Task entry and `.omp-flow/workflow/index.md` when it exists. Follow only useful ordinary + links to the affected Workflow Markdown, authored fragments, archived Task evidence, Reviews, + handoffs, and Sleep Candidates. +2. Separate repository facts, repeated practice findings, contrary evidence, local exceptions, + applicability boundaries, and unresolved questions. +3. Write the smallest candidate revision in the assigned Task output. State the affected Workflow or + fragment, proposed prose change, expected benefit, counterexample, regression risk, and replay or + verification plan. +4. Do not edit canonical production Workflow policy, Skills, Hooks, or Runtime as an automatic result + of this maintenance analysis. Promotion is a separate bounded Work after independent review and + human decision. +5. If a production change is authorized, the Main session creates the bounded Work and uses + `operation start`; forward its complete returned assignment unchanged. Never manufacture an + assignment, actor ID, receipt, dependency, or runtime phase. + +## Boundaries + +- Do not parse Workflow Markdown, folder names, headings, links, or frontmatter into machine state. +- Do not create a graph runtime, route schema, exact-topology identity, second dispatcher, or + automatic Workflow selector. +- Do not let model name alone select Lite or bypass a required boundary. +- Do not turn one Task-specific observation into a global Workflow rule without replay, contrary + evidence, applicability limits, independent review, and human calibration. +- Do not spawn another workflow sub-agent. diff --git a/.omp/skills/omp-flow/SKILL.md b/.omp/skills/omp-flow/SKILL.md index cf4a0889..0b5e1efe 100644 --- a/.omp/skills/omp-flow/SKILL.md +++ b/.omp/skills/omp-flow/SKILL.md @@ -19,16 +19,16 @@ implement work itself, or manufacture missing knowledge. ## Start Here -1. Confirm `.omp-flow/workflow.md` and `.omp-flow/scripts/omp_flow.py` exist. If not, stop and ask - whether to initialize the requested Harness adapter. +1. Confirm `.omp-flow/scripts/omp_flow.py` and at least one Workflow source: + `.omp-flow/workflow/index.md` or legacy `.omp-flow/workflow.md`. A fresh project should use the + index; an existing project may still use the legacy file during migration. If the runtime kernel + or both Workflow sources are missing, stop and ask whether to initialize the requested Harness + adapter. 2. Resolve this session's active task directory through the runtime or select one explicitly. - `task select ` works with a native Harness session or the repository-local terminal - lane. When concurrent callers may share that terminal lane, pass `--task ` to commands - that accept it; an explicit Task always takes precedence over the convenience pointer. Never - borrow another session's active task. + Never borrow another session's active task. 3. Open the Bundle root `index.md`. Follow only links useful to the current request. -4. Read `.omp-flow/workflow.md` when the Bundle or requested operation needs details not present - in this router. +4. Read `.omp-flow/workflow/index.md` when present, then follow its ordinary links to the Workflow + Markdown relevant to this Task. Fall back to `.omp-flow/workflow.md` only for legacy projects. 5. Treat a missing root index or required entry Concept as a blocker. Do not fall back to `task.json`, CSV/JSONL stores, generated context, or chat reconstruction. diff --git a/package-lock.json b/package-lock.json index 83d6cc94..242724ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "omp-flow", - "version": "0.3.1", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "omp-flow", - "version": "0.3.1", + "version": "0.4.0", "license": "MIT", "dependencies": { "inquirer": "^9.3.7" diff --git a/package.json b/package.json index dd328084..c000e5d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "omp-flow", - "version": "0.3.1", + "version": "0.4.0", "description": "Agent-native OKF task Bundles with a minimal portable runtime kernel.", "type": "module", "main": "dist/index.js", diff --git a/src/cli/init.ts b/src/cli/init.ts index f78613b1..9947e959 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -92,7 +92,7 @@ const SKILL_NAMES = [ 'omp-flow-execute', 'omp-flow-finish', 'omp-flow-implement', - 'omp-flow-learn', + 'omp-flow-workflow-maintainer', 'omp-flow-qbd', 'omp-flow-research', 'omp-flow-sleep', @@ -101,13 +101,6 @@ const SKILL_NAMES = [ ] as const; const FLOW_STATUS_SKILL_NAME = 'flow-status' as const; -const LEARN_INDEX_FILES = [ - 'index.md', - 'daily/index.md', - 'threads/index.md', - 'retrospectives/index.md', -] as const; - const CODEX_AGENT_FILES = [ 'omp-flow-architect.toml', 'omp-flow-check.toml', @@ -128,6 +121,15 @@ const PYTHON_CORE_FILES = [ 'common/sleep_store.py', ] as const; +const WORKFLOW_LIBRARY_FILES = [ + 'index.md', + 'full-delivery.md', + 'lite.md', + 'research.md', + 'experiment.md', + 'workflow-maintenance.md', +] as const; + const CORE_RESOURCES: readonly ManagedResource[] = [ { sourcePath: path.join('templates', '.omp-flow', 'gitignore'), @@ -139,9 +141,9 @@ const CORE_RESOURCES: readonly ManagedResource[] = [ destinationPath: path.join('.omp-flow', 'workflow.md'), group: 'core', }, - ...LEARN_INDEX_FILES.map(fileName => ({ - sourcePath: path.join('templates', '.omp-flow', 'learn', ...fileName.split('/')), - destinationPath: path.join('.omp-flow', 'learn', ...fileName.split('/')), + ...WORKFLOW_LIBRARY_FILES.map(fileName => ({ + sourcePath: path.join('templates', '.omp-flow', 'workflow', fileName), + destinationPath: path.join('.omp-flow', 'workflow', fileName), group: 'core' as const, })), ...PYTHON_CORE_FILES.map(fileName => ({ diff --git a/templates/.omp-flow/learn/daily/index.md b/templates/.omp-flow/learn/daily/index.md deleted file mode 100644 index e525fead..00000000 --- a/templates/.omp-flow/learn/daily/index.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -type: "Learn Daily Index" -title: "Daily learning encounters" ---- - -# Daily learning encounters - -Daily bundles preserve a useful, resumable checkpoint from one real dated Human–Agent co-learning -encounter: its discussion, challenge, examples, corrections, current understanding, or open point. -Create one only when the encounter benefits from preservation. - -Name a bundle `YYYY-MM-DD-/` and give it an authored `index.md` that orients a returning human -and Agent. Add only descriptive Markdown Concepts warranted by the encounter. A Daily may stand -alone; it never requires a Thread or Retrospective companion. This index aids navigation and need -not exhaustively list every bundle. diff --git a/templates/.omp-flow/learn/index.md b/templates/.omp-flow/learn/index.md deleted file mode 100644 index 9141413b..00000000 --- a/templates/.omp-flow/learn/index.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -type: "Learn Index" -title: "Human–Agent Learn" ---- - -# Human–Agent Learn - -Learn is the repository space for deliberate, human-present Human–Agent co-learning: provisional -digestion, explanation, challenge, correction, and reflection that may help both participants revise -their understanding. Production work normally pauses while a Learn conversation is underway and -resumes only when the human returns the conversation to production. - -## Stable affordances - -- [Daily](daily/index.md) preserves a useful checkpoint from one dated co-learning encounter. -- [Threads](threads/index.md) carries a shared model, live disagreement, and useful links across - encounters when continuity is actually needed. -- [Retrospectives](retrospectives/index.md) reflects on a substantive change, problem, or lesson in - technical understanding, human digestion, Agent explanation or assumptions, or collaboration. - -These indexes are navigation aids, not exhaustive manifests. The directories are distinct stable -capabilities, not a required companion set: a Daily may stand alone, and a Thread or Retrospective -is created only when the learning warrants it. - -## Dated bundles - -Place a bundle immediately below the relevant stable directory and name it -`YYYY-MM-DD-/`, using its establishment date and a readable topic. Every bundle has an -authored `index.md` that gives a returning human and Agent the useful current understanding or open -question and links to related Concepts only when those links aid resumption. - -A bundle may also contain concrete, descriptive Markdown Concepts warranted by the discussion, -such as a worked example, counterargument, shared model, explanation to revisit, open question, or -reflection. There is no required companion bundle, transcript, fixed body schema, lifecycle, -machine-validated identifier, or exhaustive bundle index. - -## Authority boundary - -Learn is provisional authored context. It does not advance, pause-state, approve, or otherwise -alter an omp-flow Task; Task commitments remain in the applicable Task Bundle. It is not Wiki -authority and is never promoted automatically; established knowledge reaches the Wiki only through -ordinary evidence-based Wiki maintenance. Ordinary links to Task or Wiki Concepts provide context, -not authority transfer. diff --git a/templates/.omp-flow/learn/retrospectives/index.md b/templates/.omp-flow/learn/retrospectives/index.md deleted file mode 100644 index 0b681a59..00000000 --- a/templates/.omp-flow/learn/retrospectives/index.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -type: "Learn Retrospective Index" -title: "Learning retrospectives" ---- - -# Learning retrospectives - -Retrospective bundles reflect on a substantive change, problem, or lesson in technical -understanding, human digestion, Agent explanations or assumptions, or the way the participants -collaborate. Create one only when reflection itself will help a later encounter; do not create one -to complete a companion set. - -Name a warranted bundle `YYYY-MM-DD-/` and give it an authored `index.md` for resumption, -with optional descriptive Markdown Concepts when useful. A Daily may stand alone without a -Retrospective. This index supports discovery rather than an exhaustive inventory or completion -record. diff --git a/templates/.omp-flow/learn/threads/index.md b/templates/.omp-flow/learn/threads/index.md deleted file mode 100644 index 6fcf386e..00000000 --- a/templates/.omp-flow/learn/threads/index.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -type: "Learn Thread Index" -title: "Cross-encounter learning threads" ---- - -# Cross-encounter learning threads - -Thread bundles preserve continuity only when a topic genuinely spans encounters. They can maintain -the current shared model, a live disagreement or unresolved question, and useful ordinary links to -the Daily encounters that changed the topic. - -Name a warranted bundle `YYYY-MM-DD-/` and maintain an authored `index.md` for resumption, -with optional descriptive Markdown Concepts only when useful. A Daily does not require a Thread, -and a Thread is not a task, dependency graph, or learning lifecycle. This index aids navigation and -is not an exhaustive manifest. diff --git a/templates/.omp-flow/scripts/common/active_task.py b/templates/.omp-flow/scripts/common/active_task.py index 6275d86b..2bc03b9c 100644 --- a/templates/.omp-flow/scripts/common/active_task.py +++ b/templates/.omp-flow/scripts/common/active_task.py @@ -59,10 +59,7 @@ def resolve_context_key(payload: dict[str, Any] | None = None) -> str | None: value = os.environ.get(env_name, "").strip() if value: return _context_key(env_platform, value) - # Runtime state is already repository-local. A fixed local lane keeps the - # CLI usable when a Harness does not propagate its session identity into - # shell commands, without introducing a project-global database. - return _context_key("local", "terminal") + return None def _session_path(repo: Path, context_key: str) -> Path: @@ -89,7 +86,9 @@ def set_active_task(repo: Path, task_id: str, payload: dict[str, Any] | None = N task_dir(repo, task_id) key = resolve_context_key(payload) if not key: - raise WorkflowError("Unable to resolve a task-selection identity") + raise WorkflowError( + "No session identity. Set OMP_FLOW_CONTEXT_ID or run inside a supported Harness session." + ) atomic_write_json( _session_path(repo, key), { diff --git a/templates/.omp-flow/scripts/common/task_store.py b/templates/.omp-flow/scripts/common/task_store.py index d3194bf4..ad33a4a6 100644 --- a/templates/.omp-flow/scripts/common/task_store.py +++ b/templates/.omp-flow/scripts/common/task_store.py @@ -7,7 +7,7 @@ from pathlib import Path from typing import Any -from .active_task import clear_task_sessions, set_active_task +from .active_task import clear_task_sessions, resolve_context_key, set_active_task from .io import WorkflowError, atomic_write_text from .paths import task_dir, tasks_dir @@ -67,6 +67,10 @@ def create_task( parent: str | None = None, no_start: bool = False, ) -> dict[str, Any]: + if not no_start and resolve_context_key() is None: + raise WorkflowError( + "No session identity. Set OMP_FLOW_CONTEXT_ID or pass --no-start." + ) task_id = build_task_id(title, slug) target = tasks_dir(repo) / task_id if target.exists(): diff --git a/templates/.omp-flow/scripts/omp_flow.py b/templates/.omp-flow/scripts/omp_flow.py index cf33eeca..8a0733d8 100644 --- a/templates/.omp-flow/scripts/omp_flow.py +++ b/templates/.omp-flow/scripts/omp_flow.py @@ -48,14 +48,15 @@ def _repo(args: argparse.Namespace) -> Path: def _selected_task(repo: Path, explicit: str | None = None) -> str: - if explicit: - task_dir(repo, explicit) - return explicit active = resolve_active_task(repo) if not active.task_id: raise WorkflowError("No active task for this session") if active.stale: raise WorkflowError(f"Active task pointer is stale: {active.task_id}") + if explicit and explicit != active.task_id: + raise WorkflowError( + f"Task/session mismatch: active={active.task_id}, requested={explicit}" + ) return active.task_id @@ -310,15 +311,15 @@ def leaf( create.add_argument("--parent") create.add_argument("--no-start", action="store_true") leaf(task_sub, "list", "List task Bundle directories") - leaf(task_sub, "current", "Show the active task pointer for this session or local terminal") - select = leaf(task_sub, "select", "Select a task Bundle for this session or local terminal") + leaf(task_sub, "current", "Show the session-local active task pointer") + select = leaf(task_sub, "select", "Select a task Bundle for this session") select.add_argument("task", nargs="?") select.add_argument("--task", dest="task_flag") show = leaf(task_sub, "show", "Show task Bundle paths without parsing Markdown") show.add_argument("task", nargs="?") archive = leaf(task_sub, "archive", "Archive a Bundle with no active operations") archive.add_argument("task", nargs="?") - leaf(task_sub, "clear", "Clear the active task pointer for this session or local terminal") + leaf(task_sub, "clear", "Clear the session-local active task pointer") operation = leaf(sub, "operation", "Coordinate native work with opaque runtime receipts") operation_sub = operation.add_subparsers(dest="operation_action", required=True) diff --git a/templates/.omp-flow/workflow.md b/templates/.omp-flow/workflow.md index e58da41a..06d7d063 100644 --- a/templates/.omp-flow/workflow.md +++ b/templates/.omp-flow/workflow.md @@ -1,5 +1,9 @@ # OMP-Flow Development Workflow +The authored Workflow Library at `workflow/index.md` is the preferred entry for new Tasks. This +legacy full-delivery document remains managed during migration; it is not runtime state and is not +automatically replaced by a parser or selector. + ## Principles 1. Each task directory is one portable OKF v0.2 Bundle. Markdown Concepts, authored indexes, @@ -109,12 +113,6 @@ identity, authorization, data, or irreversible-effect boundaries. Runtime records live under ignored `.omp-flow/.runtime/`. External repository clones live under the ignored acquisition cache `.omp-flow/cache/repos/`. Neither is portable task knowledge. -Task choice follows one precedence rule: an explicit `--task ` names the Bundle for that -command; otherwise the runtime reads the caller's selected Task. Native Harness sessions retain -separate selection lanes. If a Harness does not propagate its session identity into shell commands, -the repository-local terminal lane remains usable instead of rejecting selection. Concurrent -callers in that lane use explicit `--task` arguments and do not depend on its convenience pointer. - ## Source Acquisition An external clone is a read-only acquisition cache. A task-local Reference Concept records the diff --git a/templates/.omp-flow/workflow/experiment.md b/templates/.omp-flow/workflow/experiment.md new file mode 100644 index 00000000..3c969c35 --- /dev/null +++ b/templates/.omp-flow/workflow/experiment.md @@ -0,0 +1,38 @@ +# Experiment Workflow + +Experiment is the route for a question that needs a controlled comparison, repeated trials, or a +measured failure mode. The experiment document describes the method and evidence; it does not become +a second dispatcher or a production policy. + +## Design + +Write the question and hypothesis in the Task Bundle. Fix the source revision, configuration, +inputs, treatment and control, evaluator, metric, budget, trial count, and stop condition before +running. Define what result would support the hypothesis, weaken it, or make the comparison invalid. +Keep the change surface and environmental assumptions visible. + +## Run + +Execute each bounded trial through the normal assignment contract. Give each trial a stable human +label and preserve its inputs, commands, outputs, timing, failures, and deviations. Keep control and +treatment results separate. When a trial is interrupted or malformed, record that fact instead of +silently treating it as a successful observation. + +## Judge + +Compare the observed result with the fixed verifier and the predeclared metric. Report effect, +uncertainty, counterexamples, failed or inconclusive trials, and known confounders. Distinguish a +measured result from an Agent or reviewer opinion. Re-run only when the experiment definition says a +repeat is meaningful; otherwise preserve the failure as evidence. + +## Close + +State the conclusion, its applicability boundary, and the next decision: keep, reject, narrow, +repeat, or stop. Preserve the exact source and result set so another reader can replay the claim. A +reusable conclusion enters a separate Design or Workflow-maintenance decision with source links and +human calibration before it changes production Workflow, Skill, or Runtime. + +## Execution + +Main selects each bounded Work and `operation start` produces the exact assignment. Harnesses own +native execution and concurrency; the Task Bundle owns the experiment definition and evidence. diff --git a/templates/.omp-flow/workflow/full-delivery.md b/templates/.omp-flow/workflow/full-delivery.md new file mode 100644 index 00000000..3108234b --- /dev/null +++ b/templates/.omp-flow/workflow/full-delivery.md @@ -0,0 +1,300 @@ +# OMP-Flow Development Workflow + +Full Delivery is the complete path for consequential product work. It carries the reasoning, decision, +assignment, implementation, review, and integration method used by the repository. + +## Principles + +1. Each task directory is one portable OKF v0.2 Bundle. Markdown Concepts, authored indexes, + prose, placement, and ordinary relative links carry task meaning. +2. Reality and practice outrank authored theory. Preserve the authority relationship + `stable dialectical core -> necessary procedural safeguards -> replaceable Skills, cards, + tests, and Harness surfaces`; delivery may change, but it must not reverse the core or weaken + the safeguards. +3. A non-trivial Explore starts with a provisional first-principles anchor(第一性锚定): the + concrete problem, irreducible outcome, non-sacrificable human boundaries, counter-hypothesis, + and evidence that would revise it. This is authored direction, not a fixed file, checklist, or + lifecycle phase; mechanical low-ambiguity work may proceed directly. +4. Contradiction analysis(矛盾分析)identifies the changing conflict that currently governs the + decision: the principal contradiction(主要矛盾). Track how practice transforms it; do not let + a secondary or invented problem displace it merely because that problem has fluent terminology. +5. Brainstorm and research are distinct operations in one Explore spiral. Questions drive + investigation; practice-led reasoning and practice tests(实践论、实践检验)use repository, + runtime, user, and other relevant reality to confirm, revise, or falsify provisional knowledge + before that knowledge returns to implementation, verification, and feedback. +6. Apply concrete-problem analysis(具体问题具体分析)and anti-formalism(反形式主义): + choose rigor in proportion to actual consequences and remove ceremony that does not improve a + real decision, without weakening necessary safeguards. +7. Use the Feynman Technique(费曼技巧)and “do not fool yourself” for important causal claims: + explain cause and effect in plain language, expose gaps hidden by workflow or solution jargon, + distinguish evidence from inference and unknowns, and return unsupported claims to evidence or + human calibration. +8. These anchors are flexible aids with observable work consequences, not required headings, + teach-back artifacts, question counts, checklists, parser inputs, runtime fields, phases, gates, + or model-thought scripts. Their wording and delivery remain replaceable as practice changes. +9. Investigation precedes accepted design; design precedes implementation. +10. Agents receive paths and read normal Markdown. OmpFlow does not parse Concept bodies, fixed + headings, lists, filenames, or arbitrary frontmatter into workflow state. +11. Code owns only irreducible mechanics: session and actor identity, safe paths, locks, atomic + external side effects, opaque dispatch receipts, and requested directory operations. +12. Harness-native agents, models, dispatch, concurrency, progress, cancellation, and result + delivery remain native. +13. Missing required entry content or mechanical identity fails visibly. Optional links remain + best-effort and there is no legacy fallback. + +## Knowledge Map + +The Bundle root `index.md` is an authored map, not a manifest. A typical large task may contain: + +```text +/ +├── index.md +├── task.md +├── brainstorm.md +├── research/ +├── reference/ +├── context/ +├── prd.md +├── design.md +├── work/ +├── review/ +└── qbd/ +``` + +Only the Bundle root, root index, and normal Markdown Concepts are architectural requirements. +Directories and nested indexes exist only when they improve discovery. Concepts have descriptive +paths; persistent filenames do not encode topology or dispatch IDs. + +## Normal Flow + +```text +provisional first-principles anchor + ↓ +brainstorm Concept ↔ research / Reference Concepts + confirm / revise / falsify + ↓ +selected synthesis → PRD / Design + ↓ +independent QbD 1 audit → human decision + ↓ +authored work map and bounded work Concepts + ↓ +independent QbD 2 audit → human decision + ↓ +native implementation → linked handoff + ↓ +independent review → linked Review Concept + ↓ +integration → immediate Wiki harvest when already evidenced → commit checkpoint → archive + ↓ +archived-source handoff → `omp-flow-sleep` → zero or more reviewable Candidates +``` + +This is a normal reasoning direction, not a Python lifecycle. Values, risk tolerance, and +non-negotiable outcomes come from the human before Agent challenge. For evidence-led technical +choices, an Agent may recommend first only when it also gives the strongest counter-case and the +evidence that would overturn the recommendation. Evidence may return Explore to framing, and +material execution findings may return to design and the applicable human gate. Anti-formalism +(反形式主义)means removing work that does not improve a real decision, not weakening mechanical +identity, authorization, data, or irreversible-effect boundaries. + +## Semantic and Mechanical Ownership + +| Information | Owner | +|---|---| +| Task purpose, framing, sources, provenance, findings, alternatives | Bundle Concepts | +| Requirements, design, decisions, interfaces, work intent and grouping | Bundle Concepts | +| Handoffs, reviews, audits, human decisions, navigation | Bundle Concepts | +| Active task for one session, safe path confinement | Runtime | +| Native actor/process identity and opaque dispatch receipt | Runtime/Harness | +| Locks, duplicate side-effect prevention, atomic create/archive | Runtime | + +## How to work this path + +### 1. Frame the problem + +Create the Task and write the desired outcome in concrete terms. Name the human boundary that cannot +be traded away, the consequence that matters most, the current principal contradiction, and a +counter-hypothesis. Define what observation would change the framing. This gives later research and +design a question to answer instead of a solution to defend. + +### 2. Explore through practice + +Use Brainstorm to expose assumptions, alternatives, and unresolved questions. Use Research and +Reference Concepts to acquire repository or external evidence with provenance. Compare evidence +against the counter-hypothesis and record what is fact, inference, and unknown. A synthesis is ready +when it states the problem, evidence, applicability boundary, and decision it supports. If evidence +changes the problem, return to framing. + +### 3. Design and calibrate + +Turn the selected synthesis into requirements, interfaces, acceptance evidence, and a bounded Design. +State the smallest useful product behavior, major non-goals, failure consequences, and the boundary +between authored meaning and mechanical runtime work. An independent QbD 1 audit challenges the +framing, sources, requirements, design, and interfaces. The human decides whether to proceed, revise, +defer, safely degrade, or stop; an audit verdict alone is not approval. + +### 4. Decompose and assign + +Translate the approved Design into a descriptive work map and bounded Work Concepts. Each Work names +its objective, allowed code or document scope, entry Concepts, output boundary, acceptance evidence, +and dependencies in authored prose. QbD 2 checks that the map can realize the Design and that each +boundary is executable. Main starts each native operation separately and forwards its complete +assignment unchanged to the matching Harness role. + +### 5. Implement and review + +The Implementer reads the assigned Work and useful Design links, changes only the bounded surface, +runs the real verifier, and writes a linked handoff containing files, commands, results, decisions, +and caveats. A different Reviewer reads the Work, handoff, real diff, and relevant design evidence, +then writes a Review Concept with findings and verdict. A material finding returns to the Work or +Design for repair and another independent review. + +### 6. Integrate and finish + +Integration checks the accepted behavior across the changed boundary and resolves review findings. +When the evidence is already reusable, harvest it into the project Wiki through the Wiki Skill. +Create the requested commit checkpoint, then archive the Bundle only after operations are complete and +navigation remains valid. The archived source receipt is the input to Sleep, which may produce +reviewable Candidates without promoting them to project knowledge. + +Runtime records live under ignored `.omp-flow/.runtime/`. External repository clones live under +the ignored acquisition cache `.omp-flow/cache/repos/`. Neither is portable task knowledge. + +## Source Acquisition + +An external clone is a read-only acquisition cache. A task-local Reference Concept records the +exact upstream URL and revision, useful anchors, local interpretation, caveats, and links to the +question or decision it informs. Exact attachments are optional and justified only when the +revision plus links are insufficient. + +Do not copy findings merely to promote them between tiers. Do not create paired content and +metadata files, a Reference selector grammar, or a mandatory Reference index. + +## Agent Assignment Contract + +Every native assignment explicitly supplies: + +1. task Bundle root; +2. role and bounded objective; +3. most relevant entry Concept; +4. allowed output Concept path and/or code scope; +5. native actor ID; +6. opaque dispatch receipt and optional predecessor receipt; +7. verification and completion conditions. + +The operation interface is path based: + +```text +operation start task entry role actor-id objective output [predecessor] +operation show receipt +operation list [task] +operation finish receipt actor-id state [external-receipt] +``` + +`operation start` returns the Bundle, entry, output boundary, and opaque receipt used by the native +assignment. `operation finish` binds the same actor ID. A review predecessor must be a completed +implementation operation, and the reviewer actor must differ from its implementer. + +### Executable native dispatch + +`operation start` is the sole producer of the executable assignment. Forward its complete +`assignment` string to the native task item unchanged. Its strict v1 `ompFlowDispatch` JSON +descriptor must remain the first non-blank line: do not parse, reserialize, summarize, prepend +prose, append instructions, drop fields, or reconstruct any part of it. + +For every native task item, set the item `id` to the returned operation's `actor_id` (the +descriptor's `actorId`), select the native role that matches the descriptor `role`, and set the +item assignment to that exact returned string. A mismatch fails closed before the child starts. + +A batch repeats the complete sequence independently for each item: one `operation start`, one +returned assignment, and one matching `(id = actorId, role, assignment)` tuple. Never reuse an +operation, receipt, actor/assignment pair, or shared rewritten prompt across batch items. +Implementation predecessors and review correlation travel in each operation-produced descriptor, +including predecessor output; callers do not add, infer, or remove them. + +The receiving agent reads the entry Concept and follows only useful links. Missing required entry +content blocks the assignment; missing optional links do not. Never substitute generated XML, +row JSON, JSONL manifests, `context/index.json`, rendered Reference slices, or accumulated chat. + +## Role Entry Points + +| Work | Entry and output | +|---|---| +| Brainstorm | framing Concept; update the assigned framing output | +| Research | question/framing Concept; write a bounded research or Reference Concept | +| Design | selected synthesis; write linked PRD, Design, decisions, and interfaces | +| QbD | design or authored work-map Concept; write one independent audit Concept | +| Implementation | descriptive work Concept; change bounded code and write linked handoff | +| Review | same work Concept, linked handoff, and changed code; write Review Concept | + +Sub-agents do not spawn workflow sub-agents. OMP project agent frontmatter controls child tools; +Codex and Claude use their native agent definitions. Hooks pass mechanical identity and paths; +they do not render task meaning. + +## Work and Review + +`work/index.md`, when useful, communicates normal ordering and parallel groups in authored prose. +The main session interprets that view and uses the Harness to dispatch non-conflicting work. Do +not add an exact-topology filename grammar, `dependsOn`, `plan.json`, or another machine DAG. + +An implementer writes or updates the promised handoff Concept and links it back to its work. An +independent reviewer reads the work, handoff, real diff, and useful design links, then writes a +Review Concept that states its subject, findings, commands/results, and verdict in readable +language. Python does not parse or duplicate that judgment into a row status or Evidence ledger. + +## QbD and Human Decisions + +QbD 1 challenges the problem, selected synthesis, requirements, design, sources, and interfaces. +QbD 2 challenges whether the work map and each bounded work Concept can realize the approved +design. The auditor writes only the assigned audit Concept. A model PASS is not human approval. + +An audit is scoped to the current decision, unacceptable consequences, current change, and linked +prior human decisions. A blocking finding must connect evidence through a concrete consequence to +the decision, state the smallest remedy, and explain why hiding, disabling, narrowing scope, +`unavailable`, or another safe degradation is insufficient. `FAIL` requires evidence of a critical +falsehood, authorization or data violation, irreversible harm, or an unrealizable core path. +`NEEDS_EVIDENCE` applies only when missing evidence prevents judging such a consequence. Other +uncertainty and craft improvement are advisory; `PASS` may carry them as residual risk or later +verification. + +The human decision is a linked Concept and determines the next action; a verdict never authorizes +an automatic repair or fresh audit. Advisory risk, `PASS` residual risk, or risk made non-blocking +by safe degradation may be accepted. An unresolved `FAIL` may only be repaired, removed or safely +degraded, deferred, or stopped. Material `NEEDS_EVIDENCE` may only receive evidence, removal or +safe degradation, deferral, or stop. Neither can enter implementation unchanged under an +"accepted risk" label. + +If the human considers changing a non-negotiable boundary, return to Brainstorm/Design and record +the changed problem definition. When necessary, use a targeted, human-first Grill: the human +states the value and risk rationale, then the Agent supplies the strongest counter-case, +consequences, and a lighter degradation. A re-audit is a human-calibrated, scoped response to new +material evidence or substantive change; it inherits closed findings and prior decisions instead +of reopening them by default. Do not encode approval, materiality, or risk as runtime phase, gate +pointer, digest, parsed frontmatter, or Hook inference. + +## Completion and Archive + +Finish only after accepted work has current linked independent reviews and integration checks +satisfy the PRD. Use the native `omp-flow-wiki` Skill when evidence already supports immediate +promotion; temporary task reasoning remains in the Task Bundle. + +Archive is an explicit directory operation. It is blocked while runtime operations are active and +preserves relative navigation. A committed Task checkpoint lets Archive issue a source commit/tree +and opaque archived-source receipt. Finish forwards that receipt to the native `omp-flow-sleep` +Skill; it never reconstructs an assignment from the moved path. Sleep creates reviewable Candidate +Concepts but cannot grant Wiki authority. Git is the authored history; runtime/session data and +acquisition caches remain ignored. + +## Guardrails + +1. Do not translate retired JSON/CSV/JSONL schemas one-for-one into Markdown. +2. Do not parse authored Markdown into phase, topology, status, dependency, gate, or verdict state. +3. Do not require fixed headings, list shapes, filename grammars, or link closure. +4. Do not reconstruct a context package or silently read a legacy store when an entry is missing. +5. Do not let an implementer provide its own independent review. +6. Do not treat a cache clone as accepted task knowledge. +7. Do not archive because native agents merely returned success. +8. Preserve unrelated user changes and report failed commands honestly. +9. Do not turn authored values, risk, materiality, an Explore anchor, or audit calibration into + runtime state, a fixed Concept shape, or an exhaustive model thought process. diff --git a/templates/.omp-flow/workflow/index.md b/templates/.omp-flow/workflow/index.md new file mode 100644 index 00000000..c4d09e20 --- /dev/null +++ b/templates/.omp-flow/workflow/index.md @@ -0,0 +1,23 @@ +--- +okf_version: "0.2" +--- + +# Workflow Library + +Every Workflow Task starts with `task create`. Read the Workflow that matches the work's main +question, consequence, and verifier; the Task Bundle records the purpose, boundaries, Concepts, +assignment, evidence, and result. + +## Workflows + +- [Full Delivery](full-delivery.md) — complete product work from framing through design, human + decisions, bounded implementation, independent review, integration, and archive. +- [Lite](lite.md) — a local reversible change with a known verifier and small decision surface. +- [Research](research.md) — evidence, comparison, explanation, or synthesis before a product change. +- [Experiment](experiment.md) — fixed inputs, controlled comparison, repeated trials, and measured + results, including failures and negative findings. +- [Workflow Maintenance](workflow-maintenance.md) — evidence-led candidates for improving this + authored library. + +The links are authored navigation. Workflow documents guide reasoning and evidence; Runtime and +Harnesses continue to own session, assignment, actor identity, execution, and atomic side effects. diff --git a/templates/.omp-flow/workflow/lite.md b/templates/.omp-flow/workflow/lite.md new file mode 100644 index 00000000..ed5a0c7b --- /dev/null +++ b/templates/.omp-flow/workflow/lite.md @@ -0,0 +1,32 @@ +# Lite Workflow + +Lite is the short path for a local, reversible change whose intended behavior and verifier are +already known. It keeps the Task Bundle, assignment, and evidence contract while reducing the amount +of framing and review needed for a small change. + +## Method + +1. **Create the Task.** Start with `task create`, then read `workflow/index.md` and this document. +2. **Frame the work.** Record the objective, affected surface, output boundary, done condition, and + focused verifier in the Task Bundle. Note the one consequence that would make Lite inappropriate. +3. **Inspect the baseline.** Read the relevant code and nearby tests or usage. Reproduce the current + behavior when the change fixes a bug. Keep the change local and understandable. +4. **Make the smallest change.** Preserve existing interfaces and conventions. Remove temporary + debugging or experiment residue before verification. +5. **Verify the contract.** Run the focused verifier and exercise the changed path. Check the + boundary cases named in the Work Concept. Record command, result, and any remaining limitation. +6. **Hand off.** Write a linked handoff with changed files, evidence, and caveats. Use an independent + Review when the surface, consequence, or acceptance contract warrants another actor. + +## Choose another path + +Use Research when the goal or evidence is unclear. Use Full Delivery when the change affects a public +contract, identity or authorization boundary, persistent data, architecture, or an irreversible +operation. A repeated failed verifier is evidence that the work needs a design decision, not a reason +to keep shortening the process. + +## Execution + +Main selects the bounded Work and `operation start` produces its exact assignment. The Harness owns +native execution, concurrency, progress, cancellation, and actor identity; the Work and handoff own +the meaning and evidence. diff --git a/templates/.omp-flow/workflow/research.md b/templates/.omp-flow/workflow/research.md new file mode 100644 index 00000000..98954b11 --- /dev/null +++ b/templates/.omp-flow/workflow/research.md @@ -0,0 +1,35 @@ +# Research Workflow + +Research is the route for work whose main product is evidence, explanation, comparison, or a +bounded recommendation. It is complete when the Task has a useful, sourced conclusion; it does not +need to become product implementation. + +## Method + +1. **Create and frame the Task.** Start with `task create`. State the decision or question, what is + known, what is uncertain, a provisional explanation, and the observation that would change it. +2. **Acquire evidence.** Read repository sources first when they answer the question. For external + material, record the exact URL or revision, useful anchors, local interpretation, and caveats in a + Reference Concept. Keep acquisition separate from the conclusion. +3. **Compare explanations.** Test the provisional explanation against direct observations, examples, + counterexamples, and competing interpretations. Separate fact, inference, and open question. +4. **Write the synthesis.** State the finding, confidence, applicability boundary, unresolved risk, + and the evidence that supports each important claim. Link the synthesis to the question and its + sources so another reader can replay the reasoning. +5. **Choose the next useful result.** Stop with knowledge or a bounded recommendation when that is + the requested outcome. Continue Research when the evidence is insufficient. Move to Design or + Full Delivery when the synthesis changes a product contract, architecture, implementation scope, + or another decision that needs stronger safeguards. + +## Research output + +The normal output is a linked research, Reference, or synthesis Concept plus a clear disposition. +A proportional independent challenge is useful when the conclusion will guide a consequential +decision; the challenge tests the reasoning rather than replacing the sources. + +## Execution + +Native Research Work uses the same assignment contract as other Work: Main selects the bounded +objective, `operation start` produces the assignment, and `operation finish` records the result. The +Researcher reads the assigned Bundle and writes the assigned Concept; it does not create workflow +state or dispatch another Agent. diff --git a/templates/.omp-flow/workflow/workflow-maintenance.md b/templates/.omp-flow/workflow/workflow-maintenance.md new file mode 100644 index 00000000..49e79d1e --- /dev/null +++ b/templates/.omp-flow/workflow/workflow-maintenance.md @@ -0,0 +1,38 @@ +# Workflow Maintenance + +Workflow Maintenance turns repeated practice evidence into a reviewable change candidate for the +authored Workflow Library. It is a knowledge-maintenance route: its output is a candidate, not an +automatic production edit. + +## Investigate + +Create a Task and read the Workflow Library index. Follow the links that bear on the question. Read +completed Tasks, handoffs, Reviews, failed verifiers, rework patterns, human decisions, and Sleep +Candidates. Separate repository facts, local exceptions, contrary evidence, and patterns that appear +reusable across Tasks. + +## Form a candidate + +Describe the smallest useful change to a Workflow document: the affected passage, the practice +problem, expected benefit, applicability boundary, counterexample, regression risk, and verification +plan. The candidate may clarify, split, merge, or remove prose. Keep the candidate in the Task Bundle +until its evidence is strong enough to review. + +## Replay and review + +Replay representative archived Tasks or run a bounded comparison when the claim is consequential. +Check that the candidate improves the observed problem without weakening a required identity, +authorization, data, or irreversible-effect safeguard. Write a linked handoff and obtain an +independent Review that states its evidence and verdict. + +## Promote or retain + +Human decision determines whether the candidate is promoted to the canonical template and project +copy, retained for more evidence, narrowed to an applicability boundary, or rejected. A promotion is +a separate bounded Work using the normal assignment contract, followed by verification and integration. + +## Execution + +Main selects the maintenance Work and `operation start` produces its exact assignment. The Maintainer +reads and proposes authored knowledge; Runtime and Harness retain ownership of assignments, receipts, +actor identity, and execution mechanics. diff --git a/templates/common/skills/omp-flow-check/SKILL.md b/templates/common/skills/omp-flow-check/SKILL.md index 8bccef4a..6bf1c8e4 100644 --- a/templates/common/skills/omp-flow-check/SKILL.md +++ b/templates/common/skills/omp-flow-check/SKILL.md @@ -36,10 +36,33 @@ substitute for the practice result. 4. Verify applicable linked decisions, interfaces, and source constraints. 5. Run independent focused tests and broaden checks for shared behavior or contracts. 6. Write the Review Concept at the supplied output path, link it to the work and handoff, lead - with severity-ordered findings, and record exact commands/results. + with severity-ordered findings, give every finding all applicable `HARD_BLOCKER`, + `PRINCIPAL_BLOCKER`, `WORK_FAIL`, and `ADVISORY` labels, and record exact commands/results. -PASS requires zero failed tests, no unresolved blocking finding, and full scope satisfaction. A -substantive finding returns FAIL to the owning work; do not repair it and approve your own change. +The bounded Work may be `PASS` only when all of these hold: + +- its own authored acceptance criteria are satisfied; +- the linked principal product checkpoint is not blocked, and any required principal-checkpoint + linkage is present; +- every test that exercises the Work's acceptance criteria or the linked principal checkpoint + passes. + +A finding that violates a non-negotiable boundary is `HARD_BLOCKER`; one that concretely prevents +the linked principal checkpoint is `PRINCIPAL_BLOCKER`. A failed Work acceptance criterion or test +exercising it is `WORK_FAIL`, and labels may overlap. If the failed Work is required for the next +principal checkpoint, it is also `PRINCIPAL_BLOCKER`. Any `HARD_BLOCKER`, `PRINCIPAL_BLOCKER`, or +`WORK_FAIL` makes the bounded Work `FAIL`; only `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the +principal path. A `WORK_FAIL` without either stronger label enters the recorded owning-Work +backlog. When the principal checkpoint produces `continue`, `narrow`, or `stop`, that backlog +requires explicit human/design routing for repair, deferral, removal, narrowing, or stop; it does +not autonomously create repair/review work or preempt the principal queue. + +A failed test may be `ADVISORY` only when the reviewer records evidence that it is unrelated to +the Work acceptance and principal checkpoint, pre-existing, and separately attributable, with the +exact command and result. Missing or ambiguous attribution is not a basis for `PASS`. +`ADVISORY` findings remain explicit residual risk but do not make the Work `FAIL`, reopen accepted +Work, or preempt the principal checkpoint. `PASS` may carry only those explicitly attributed +unrelated red tests and other advisory findings. ## Red Flags diff --git a/templates/common/skills/omp-flow-execute/SKILL.md b/templates/common/skills/omp-flow-execute/SKILL.md index 7cfcee23..b85e222c 100644 --- a/templates/common/skills/omp-flow-execute/SKILL.md +++ b/templates/common/skills/omp-flow-execute/SKILL.md @@ -36,8 +36,23 @@ description: Coordinate native implementation and independent review from approv runs independent checks, and writes the promised Review Concept. 5. Finish with the same reviewer actor ID. Read the review's findings and verdict as knowledge; Python does not parse or duplicate them into Evidence or row status. -6. A substantive failure returns to the owning work/design Concept for repair and another - independent review. Material design changes repeat the applicable QbD decision. +6. Classify every finding with all applicable labels: + - `HARD_BLOCKER` violates a non-negotiable safety, authority, identity, integrity, + assignment/receipt/source-binding, or irreversible-effect boundary; + - `PRINCIPAL_BLOCKER` concretely prevents the next authored principal product checkpoint; + - `WORK_FAIL` violates the bounded Work's own acceptance criteria or a test that exercises + them; it may overlap either stronger label; + - `ADVISORY` is any other recorded quality, robustness, completeness, or elegance risk. + A failed prerequisite Work required by the next principal checkpoint is also + `PRINCIPAL_BLOCKER`. `HARD_BLOCKER` and `PRINCIPAL_BLOCKER` pause the principal path and + return to the owning work/design Concept for explicit routing. `WORK_FAIL` makes that Work + `FAIL` and enters a recorded owning-Work backlog; absent a hard/principal label it must not + autonomously create repair/review work, reopen accepted Work, or preempt the principal + checkpoint. `ADVISORY` remains recorded residual risk and has none of those effects. +7. A hard/principal failure requires explicit human/design routing. When the principal checkpoint + produces `continue`, `narrow`, or `stop`, present every recorded `WORK_FAIL` backlog to the + human/design decision for explicit repair, deferral, removal, narrowing, or stop; none of those + routes is autonomous. Material design changes repeat the applicable QbD decision. For native batch execution, repeat `operation start` for every item. Preserve each independent `(id = actorId, role, assignment)` tuple; never share an operation, assignment, actor ID, receipt, @@ -45,9 +60,11 @@ or rewritten prompt across items. ## Completion -Continue without asking "should I continue?" until the accepted work has linked independent -reviews, a real blocker needs user input, or design/work must return through a gate. Then load -`omp-flow-finish`. +Continue through the authored work order toward the next principal product acceptance checkpoint. +Do not let `WORK_FAIL` backlog or `ADVISORY` findings preempt that checkpoint. Stop autonomous +continuation when a `HARD_BLOCKER` or `PRINCIPAL_BLOCKER` needs a human/design decision or when +the principal checkpoint has produced its declared continue/narrow/stop evidence; do not +manufacture completion by clearing every secondary finding. ## Red Flags diff --git a/templates/common/skills/omp-flow-learn/SKILL.md b/templates/common/skills/omp-flow-learn/SKILL.md deleted file mode 100644 index c986e8ca..00000000 --- a/templates/common/skills/omp-flow-learn/SKILL.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -name: omp-flow-learn -description: Maintain and use repository-root .omp-flow/learn for deliberate, reciprocal, resumable Human–Agent co-learning when a human is present and pursuing understanding rather than production execution. ---- - -# OMP-Flow Learn - -Use repository-root `.omp-flow/learn/` when a human is actively pursuing mutual understanding, -explanation, challenge, reconsideration, or reflection. Learn is a human-present dialogue in which -both participants may correct their models; autonomous harvesting, passive one-way tutoring, or -summary generation is not a substitute. - -Production work normally pauses during a Learn conversation. Source and code inspection, worked -examples, counterexamples, and discussion remain available, but do not execute production work -until the human returns the conversation to production. - -## Consult and bootstrap - -Open a known Learn Concept directly when its path is available. Otherwise start at -`.omp-flow/learn/index.md` and follow only ordinary links useful to the current discussion. Indexes -support navigation; they are not exhaustive manifests. - -When Learn is genuinely needed and the root is absent, bootstrap only the root index and the -`daily/`, `threads/`, and `retrospectives/` indexes described by the canonical minimal structure. -Do not pre-populate speculative encounters, a taxonomy, or companion records. - -## Preserve a resumable checkpoint - -Use judgment to select or create a bundle immediately below the relevant stable directory. Name a -new bundle `YYYY-MM-DD-/` and maintain its authored `index.md` so a later human and Agent can -recover the useful current understanding, disagreement, correction, or open point. Add only -concrete descriptive Markdown Concepts that make the learning easier to resume or challenge. - -A Daily records a useful dated encounter and may stand alone. A Thread is warranted only when a -topic needs continuity across encounters. A Retrospective is warranted only for a substantive -lesson about understanding or collaboration. Do not manufacture a Thread or Retrospective to -complete a set. - -Treat the human's corrections, rejected premises, values, business context, and objections as -learning material. Make corrected Agent assumptions visible when that helps resumption. Accuracy -comes from reciprocal correction and evidence, not from fluent prose or Agent confidence. - -## Authority and continuity boundaries - -Learn is provisional authored context, not proof of understanding or completion. - -- A Learn artifact cannot advance, pause-state, approve, dispatch, or otherwise alter an omp-flow - Task. A Task link is contextual; commitments remain authored in the applicable Task Bundle. -- A Learn artifact is not Wiki authority and is never promoted automatically. Durable knowledge - reaches `.omp-flow/wiki/` only through ordinary evidence-based Wiki maintenance. -- Cross-session continuity is limited to visible authored artifacts. Never claim a hidden user - profile, persistent personal memory, or model-weight change. - -## Select the smallest useful lens - -The lenses below are a selectable conversational repertoire, not stages, a checklist, a catechism, -an assessment, or an Agent-led teaching script. Choose the smallest lens that addresses the live -misunderstanding. Combine lenses only when one supplies a relevant corrective to another. Concrete -project facts, code, sources, worked cases, and the human's correction outrank philosophical labels. -Stop when the participants have a useful explanation, disagreement, or open point; do not march -through the remaining lenses. - -### Feynman-style self-explanation - -Invite a plain account of one concrete causal link. Find the first hidden term, unsupported leap, or -failed application, then repair it from a source or worked case. Fluency is only a possible gap -diagnostic and never proof of mastery. Do not attribute the modern packaged “Feynman Technique” to -Feynman. - -### Cargo Cult Science integrity - -For a consequential explanation, volunteer the material contrary fact, plausible alternative, -uncertainty, and observation that could change the conclusion so the other participant can judge -it. This is judgment about material disclosure, not four mandatory headings, a fixed response form, -or a ritual inventory of every caveat. - -### Grounded first principles - -Distinguish observed fact, definition, hard constraint, value choice, assumption, and convention. -Trace only premises capable of changing the present conclusion, retain the conditions under which -it should be revised, and stop when further reduction would not help. Existing knowledge and -history are evidence to examine, not impurities to discard. - -### Practice-led principal-contradiction analysis - -Offer the principal contradiction, dominant aspect, and material secondary coupling only as a -revisable prioritization hypothesis tied to current effects. Name the changed condition or practical -observation that would reorder it. Returning to practice may mean sources, code inspection, -examples, counterexamples, a diagram, or later observable verification; it does not authorize -production execution while Learn is paused. Do not import a universal single-cause claim or -political doctrine. - -### Material history or genealogy - -Use a concise temporal account only when it clarifies the present. Connect a concrete problem and -conditions to a prior arrangement, emergence or adoption, limitation, and later change; include a -discontinuity where needed and label interpretive causality. Reject inevitable or present-purpose -origin stories, mechanically economic single-causality, and political doctrine; examine interacting -causes and source support. - -### Reciprocal Socratic questioning - -Use a few genuine reasons, counterexamples, and consequence questions to test either participant's -claim. Either participant may reject a premise, ask the Agent to answer directly, or leave an aporia -open. Questions yield to direct explanation or admitted uncertainty when more useful and never -steer assent toward a conclusion the Agent selected in advance. - -### Minimal structural box-drawing - -Draw labeled ASCII, Unicode, or Mermaid boxes and arrows only when a few elements at one useful -abstraction level make a particular structural inference cheaper than prose. Check the picture -against sources, code, examples, or the participants' model; revise or discard it when it does not -help. A diagram is not inherently clarifying. - -These lenses create optional corrective friction rather than a composite routine: explanation -answers to integrity and evidence; alleged hard constraints to history; principal ranking to -secondary couplings and changed conditions; historical narrative to discontinuity and interacting -causes; questions to reciprocal answerability; and diagrams to prose, source, or practice -comparison. They do not adopt a complete philosophical school or establish mastery. - -## Keep Learn conversational - -Do not introduce an entry command, pause or save signal, fixed encounter stages, required -transcript or summary, mandatory headings, score, metric, completion gate, approval ceremony, or -per-edit human approval rule. There is no parsed body schema, lifecycle record, second task system, -or automatic learning judgment. Preserve only what is genuinely useful for reciprocal resumption, -and return to production only when the human changes the conversation back to production work. diff --git a/templates/common/skills/omp-flow-workflow-maintainer/SKILL.md b/templates/common/skills/omp-flow-workflow-maintainer/SKILL.md new file mode 100644 index 00000000..2619dea8 --- /dev/null +++ b/templates/common/skills/omp-flow-workflow-maintainer/SKILL.md @@ -0,0 +1,36 @@ +--- +name: omp-flow-workflow-maintainer +description: Inspect authored Workflow documents and practice evidence, then write a reviewable maintenance candidate without directly promoting production policy. +--- + +# OMP-Flow Workflow Maintainer + +Use this Skill only for a bounded Workflow Library maintenance Task. The Task Bundle is the source of +purpose, boundaries, evidence, output, and human decisions. + +## Method + +1. Read the Task entry and `.omp-flow/workflow/index.md` when it exists. Follow only useful ordinary + links to the affected Workflow Markdown, authored fragments, archived Task evidence, Reviews, + handoffs, and Sleep Candidates. +2. Separate repository facts, repeated practice findings, contrary evidence, local exceptions, + applicability boundaries, and unresolved questions. +3. Write the smallest candidate revision in the assigned Task output. State the affected Workflow or + fragment, proposed prose change, expected benefit, counterexample, regression risk, and replay or + verification plan. +4. Do not edit canonical production Workflow policy, Skills, Hooks, or Runtime as an automatic result + of this maintenance analysis. Promotion is a separate bounded Work after independent review and + human decision. +5. If a production change is authorized, the Main session creates the bounded Work and uses + `operation start`; forward its complete returned assignment unchanged. Never manufacture an + assignment, actor ID, receipt, dependency, or runtime phase. + +## Boundaries + +- Do not parse Workflow Markdown, folder names, headings, links, or frontmatter into machine state. +- Do not create a graph runtime, route schema, exact-topology identity, second dispatcher, or + automatic Workflow selector. +- Do not let model name alone select Lite or bypass a required boundary. +- Do not turn one Task-specific observation into a global Workflow rule without replay, contrary + evidence, applicability limits, independent review, and human calibration. +- Do not spawn another workflow sub-agent. diff --git a/templates/common/skills/omp-flow/SKILL.md b/templates/common/skills/omp-flow/SKILL.md index cf4a0889..0b5e1efe 100644 --- a/templates/common/skills/omp-flow/SKILL.md +++ b/templates/common/skills/omp-flow/SKILL.md @@ -19,16 +19,16 @@ implement work itself, or manufacture missing knowledge. ## Start Here -1. Confirm `.omp-flow/workflow.md` and `.omp-flow/scripts/omp_flow.py` exist. If not, stop and ask - whether to initialize the requested Harness adapter. +1. Confirm `.omp-flow/scripts/omp_flow.py` and at least one Workflow source: + `.omp-flow/workflow/index.md` or legacy `.omp-flow/workflow.md`. A fresh project should use the + index; an existing project may still use the legacy file during migration. If the runtime kernel + or both Workflow sources are missing, stop and ask whether to initialize the requested Harness + adapter. 2. Resolve this session's active task directory through the runtime or select one explicitly. - `task select ` works with a native Harness session or the repository-local terminal - lane. When concurrent callers may share that terminal lane, pass `--task ` to commands - that accept it; an explicit Task always takes precedence over the convenience pointer. Never - borrow another session's active task. + Never borrow another session's active task. 3. Open the Bundle root `index.md`. Follow only links useful to the current request. -4. Read `.omp-flow/workflow.md` when the Bundle or requested operation needs details not present - in this router. +4. Read `.omp-flow/workflow/index.md` when present, then follow its ordinary links to the Workflow + Markdown relevant to this Task. Fall back to `.omp-flow/workflow.md` only for legacy projects. 5. Treat a missing root index or required entry Concept as a blocker. Do not fall back to `task.json`, CSV/JSONL stores, generated context, or chat reconstruction. diff --git a/tests/learn.test.ts b/tests/learn.test.ts deleted file mode 100644 index 4c3a4fb8..00000000 --- a/tests/learn.test.ts +++ /dev/null @@ -1,484 +0,0 @@ -import fs from 'node:fs'; -import os from 'node:os'; -import path from 'node:path'; - -import { deployInitResources, getManagedResources } from '../src/cli/init.js'; - -export type LearnCheck = (condition: unknown, message: string) => asserts condition; - -const sourceRoot = process.cwd(); -const learnFiles = [ - 'index.md', - 'daily/index.md', - 'threads/index.md', - 'retrospectives/index.md', -] as const; -const skillDestinations = [ - '.agents/skills/omp-flow-learn/SKILL.md', - '.omp/skills/omp-flow-learn/SKILL.md', - '.claude/skills/omp-flow-learn/SKILL.md', -] as const; - -function read(root: string, relativePath: string): string { - return fs.readFileSync(path.join(root, ...relativePath.split('/')), 'utf8'); -} - -function filesBelow(root: string): string[] { - if (!fs.existsSync(root)) return []; - const files: string[] = []; - const visit = (directory: string): void => { - for (const entry of fs.readdirSync(directory, { withFileTypes: true })) { - const absolute = path.join(directory, entry.name); - if (entry.isDirectory()) visit(absolute); - else if (entry.isFile()) files.push(path.relative(root, absolute).split(path.sep).join('/')); - } - }; - visit(root); - return files.sort(); -} - -function hasAll(content: string, expressions: readonly RegExp[]): boolean { - return expressions.every(expression => expression.test(content)); -} - -type ProhibitedSkillBehavior = { - key: string; - expressions: readonly RegExp[]; -}; - -const prohibitedSkillBehaviors: readonly ProhibitedSkillBehavior[] = [ - { - key: 'required all-lens sequence', - expressions: [ - /\b(?:each|every|all)(?:\s+of\s+the)?(?:\s+seven)?\s+lenses?.{0,60}\b(?:is|are|becomes?|forms?)\s+(?:an?\s+)?(?:required|mandatory)\s+(?:stage|step|sequence)/is, - /\b(?:must|required to|have to)\s+(?:run|use|apply|complete).{0,30}\b(?:all|every)(?:\s+seven)?\s+lenses?\b/is, - ], - }, - { - key: 'fluent explanation proves mastery', - expressions: [ - /\bfluen\w*.{0,35}\b(?:proves?|demonstrates?|establishes?|guarantees?)\b.{0,25}\b(?:understanding|mastery|comprehension)\b/is, - ], - }, - { - key: 'infallible principal cause', - expressions: [ - /\bprincipal contradiction\b.{0,35}\b(?:infallible|universal|single true|cannot be wrong|always determines?)\b/is, - /\bprincipal contradiction\b.{0,35}\b(?:is|reveals?|identifies?)\b.{0,20}\b(?:only|single)\s+(?:real|true|material)?\s*cause\b/is, - ], - }, - { - key: 'deterministic history', - expressions: [ - /\bhistor\w*.{0,30}\b(?:is|was|becomes?|makes?).{0,15}\b(?:inevitable|predetermined|unavoidable)\b/is, - /\b(?:econom\w*|material conditions?).{0,30}\b(?:alone|solely|always)\b.{0,25}\bdetermin/is, - ], - }, - { - key: 'questions steer assent', - expressions: [ - /\bquestions?\b.{0,35}\b(?:must|should|need to|are used to)\b.{0,35}\b(?:steer|guide|lead|move)\b.{0,25}\b(?:assent|agreement|preset|preselected)\b/is, - /\b(?:steer|guide|lead)\b.{0,25}\b(?:the human|participant|user)\b.{0,30}\b(?:Agent's|preset|preselected)\s+(?:answer|conclusion|position)\b/is, - ], - }, - { - key: 'automatic diagram clarity', - expressions: [ - /\b(?:all|every|any)\s+(?:diagram|picture|box drawing)\b.{0,30}\b(?:is|are|makes?).{0,15}\b(?:inherently|automatically|always)\s+(?:clear|clarifying|helpful)\b/is, - /\bdiagrams?\b.{0,25}\b(?:guarantee|prove|ensure)\b.{0,20}\b(?:clarity|understanding|comprehension)\b/is, - ], - }, -]; - -const grammaticalNegation = - /\b(?:not|never|no|cannot|can't|mustn't|shouldn't|isn't|aren't|wasn't|weren't|doesn't|don't|didn't|reject(?:s|ed|ing)?|den(?:y|ies|ied|ying)|refus(?:e|es|ed|ing)|avoid(?:s|ed|ing)?|false)\b/i; - -function detectsProhibitedBehavior(content: string, behavior: ProhibitedSkillBehavior): boolean { - const clauses = content - .split(/(?<=[.!?])(?:[”’"')\]]*)\s+|[;\n]+/) - .map(clause => clause.trim()) - .filter(Boolean); - - return clauses.some(clause => - behavior.expressions.some(expression => { - const matcher = new RegExp(expression.source, expression.flags.replace('g', '') + 'g'); - for (const match of clause.matchAll(matcher)) { - const start = match.index ?? 0; - const context = clause.slice(Math.max(0, start - 48), start + match[0].length); - if (!grammaticalNegation.test(context)) return true; - } - return false; - }), - ); -} - -function assertContradictoryRegressionFixtures(check: LearnCheck): void { - const fixtures = [ - { - key: 'required all-lens sequence', - contradiction: 'The lenses are not a checklist. Each of the seven lenses is a mandatory stage in the encounter.', - faithful: [ - 'You do not have to apply all seven lenses.', - 'All seven lenses do not form a mandatory sequence.', - ], - }, - { - key: 'fluent explanation proves mastery', - contradiction: 'Fluency can reveal gaps. A fluent explanation demonstrates mastery of the topic.', - faithful: [ - 'A fluent explanation does not demonstrate mastery.', - 'Fluency never proves understanding.', - ], - }, - { - key: 'infallible principal cause', - contradiction: 'The ranking is revisable. The principal contradiction identifies the single true cause.', - faithful: [ - 'The principal contradiction is not the single true cause.', - 'Never say the principal contradiction is the only real cause.', - ], - }, - { - key: 'deterministic history', - contradiction: 'Reject simple inevitability stories. The historical outcome was inevitable once those conditions appeared.', - faithful: [ - 'History was not inevitable.', - 'History never makes the outcome unavoidable.', - ], - }, - { - key: 'questions steer assent', - contradiction: "Either participant may reject a premise. Questions should guide the participant toward the Agent's preselected conclusion.", - faithful: [ - 'Do not lead the participant toward a preset answer.', - 'Questions should not guide the participant toward a preselected conclusion.', - ], - }, - { - key: 'automatic diagram clarity', - contradiction: 'Discard unhelpful pictures. Every diagram is automatically clarifying.', - faithful: [ - 'Do not assume every diagram is automatically clarifying.', - 'Diagrams do not ensure understanding.', - ], - }, - ] as const; - - for (const { key, contradiction, faithful } of fixtures) { - const behavior = prohibitedSkillBehaviors.find(candidate => candidate.key === key); - check(Boolean(behavior && detectsProhibitedBehavior(contradiction, behavior)), `contract helper rejects ${key}`); - for (const control of faithful) { - check( - Boolean(behavior && behavior.expressions.some(expression => expression.test(control))), - `negated ${key} control exercises the prohibited expression`, - ); - check( - Boolean(behavior && !detectsProhibitedBehavior(control, behavior)), - `contract helper allows faithful negated ${key} rewrite`, - ); - } - } -} - -function assertIndexContract(check: LearnCheck): void { - const canonicalRoot = read(sourceRoot, 'templates/.omp-flow/learn/index.md'); - const daily = read(sourceRoot, 'templates/.omp-flow/learn/daily/index.md'); - const threads = read(sourceRoot, 'templates/.omp-flow/learn/threads/index.md'); - const retrospectives = read(sourceRoot, 'templates/.omp-flow/learn/retrospectives/index.md'); - - check( - hasAll(canonicalRoot, [ - /human.present/i, - /production.{0,40}(?:pause|halt|suspend|stop)/is, - /human.{0,70}(?:return|resume|switch).{0,35}production/is, - /daily\/index\.md/, - /threads\/index\.md/, - /retrospectives\/index\.md/, - /YYYY-MM-DD-\//, - /authored `index\.md`/i, - /descriptive Markdown Concepts/i, - /not.{0,15}exhaustive/is, - /Daily.{0,100}(?:stand\s+alone|independent|without.{0,15}companion)/is, - /(?:does not|cannot|never).{0,90}(?:alter|change|control).{0,20}omp-flow Task/is, - /(?:not|no).{0,15}Wiki.{0,15}authority/is, - /(?:never|not).{0,25}(?:promoted|publish).{0,20}automatic/is, - ]), - 'Learn root is a human-present maintenance manual with naming, resumption, pause, and authority boundaries', - ); - check( - hasAll(daily, [ - /(?:dated|encounter)/i, - /correct/i, - /resum/i, - /Daily.{0,100}(?:stand\s+alone|independent|without.{0,15}companion)/is, - /(?:never|not|does not).{0,45}(?:require|force).{0,35}(?:Thread|Retrospective)/is, - ]), - 'Daily preserves one warranted encounter without companions', - ); - check( - hasAll(threads, [ - /continuity/i, - /(?:across|spans?).{0,20}encounters?/is, - /shared model/i, - /disagreement|unresolved|open question/i, - /Daily.{0,30}(?:not|never|does not).{0,25}require.{0,15}Thread/is, - ]), - 'Threads preserve only warranted cross-encounter continuity', - ); - check( - hasAll(retrospectives, [ - /substantive/i, - /change|problem|lesson/i, - /Agent.{0,35}(?:explanations?|assumptions?)/is, - /collaborat/i, - /Daily.{0,100}(?:stand\s+alone|independent|without.{0,15}companion)/is, - ]), - 'Retrospectives preserve substantive learning or collaboration reflection only', - ); - for (const [name, content] of [['daily', daily], ['threads', threads], ['retrospectives', retrospectives]] as const) { - check( - hasAll(content, [/YYYY-MM-DD-\//, /authored `index\.md`/i, /descriptive Markdown Concepts/i, /not an exhaustive|not exhaustively|need not exhaustively|rather than an exhaustive/i]), - `${name} documents a dated authored bundle without a closed manifest`, - ); - } -} - -function assertSkillContract(skill: string, check: LearnCheck): void { - check(/^---\r?\nname: omp-flow-learn\r?\n/m.test(skill), 'Learn Skill uses canonical existing-convention frontmatter'); - check( - hasAll(skill, [ - /human.present/i, - /(?:both|either).{0,25}participants?.{0,35}(?:correct|revise|challenge)/is, - /reciprocal/i, - /resum/i, - ]), - 'Learn Skill is human-present, reciprocal, and resumable', - ); - check( - hasAll(skill, [ - /known Learn Concept.{0,20}direct/is, - /start at\s+`.omp-flow\/learn\/index\.md`/i, - /bootstrap.{0,25}(?:only|minimum).{0,20}root index/is, - /genuine.{0,15}need/is, - ]), - 'Learn Skill supports direct/index consultation and need-based bootstrap', - ); - check( - hasAll(skill, [ - /YYYY-MM-DD-\//, - /judg/i, - /Daily.{0,100}(?:stand\s+alone|independent|without.{0,15}companion)/is, - /(?:do not|never).{0,30}(?:manufacture|force|require).{0,35}(?:Thread|Retrospective)/is, - ]), - 'Learn Skill uses judgment for dated bundles and optional companions', - ); - check( - hasAll(skill, [ - /production.{0,40}(?:pause|halt|suspend|stop)/is, - /human.{0,70}(?:return|resume|switch).{0,35}production/is, - ]), - 'Learn Skill pauses production until the human returns to it', - ); - check( - hasAll(skill, [/cannot .*alter an omp-flow\s+Task/is, /not Wiki\s+authority/i, /never promoted automatically/i]), - 'Learn Skill denies Task and Wiki authority transfer', - ); - check( - hasAll(skill, [/autonomous harvesting/i, /one-way tutoring/i, /summary generation is not a substitute/i, /hidden user\s+profile/i, /persistent personal memory/i, /model-weight change/i]), - 'Learn Skill rejects autonomous, one-way, and fictional persistence substitutes', - ); - check( - hasAll(skill, [ - /selectable.{0,35}(?:lens|repertoire)/is, - /(?:not|never).{0,25}(?:stage|checklist)/is, - /(?:smallest|minimal|fewest).{0,25}(?:lens|approach)/is, - /combin\w*.{0,50}(?:correct|repair|failure|weakness)/is, - /\b(?:facts|code|sources|worked cases)\b.{0,80}\b(?:outrank|override|take priority|more authoritative)\b/is, - /human.{0,30}correction.{0,80}\b(?:outrank|override|take priority|more authoritative)\b/is, - /(?:stop|end).{0,80}(?:useful|explanation|disagreement|open point|unresolved)/is, - /(?:do not|never).{0,55}(?:remaining|all|every).{0,25}lenses/is, - ]), - 'Learn Skill selects the smallest evidence-grounded lens and stops without an exhaustive routine', - ); - check( - hasAll(skill, [ - /Feynman-style self-explanation/i, - /(?:hidden|undefined).{0,20}(?:term|concept)/is, - /(?:leap|failed application|cannot apply)/i, - /source|worked case/i, - /fluenc\w*.{0,45}(?:diagnostic|signal|possible gap)/is, - /(?:modern|packaged).{0,35}Feynman Technique/is, - ]), - 'Feynman-style explanation diagnoses and repairs a concrete gap without relying on fluency', - ); - check( - hasAll(skill, [ - /Cargo Cult Science integrity/i, - /consequential/i, - /contrary|counterevidence/i, - /alternative/i, - /uncertain/i, - /(?:change|revise|update).{0,35}(?:conclusion|claim|view)/is, - /(?:material|relevant).{0,35}(?:disclos|caveat|information)/is, - /(?:not|never).{0,70}(?:mandatory|fixed|required|ritual)/is, - ]), - 'Integrity disclosure preserves material contrary evidence without becoming a fixed inventory', - ); - check( - hasAll(skill, [ - /Grounded first principles/i, - /observed fact/i, - /definition/i, - /hard constraint/i, - /value choice/i, - /assumption/i, - /convention/i, - /premises?.{0,45}(?:chang|affect|alter).{0,25}conclusion/is, - /(?:revis|chang|update).{0,25}condition|conditions?.{0,25}(?:revis|chang|update)/is, - /(?:stop|end|cease).{0,45}(?:not help|unhelpful|no longer useful)/is, - /(?:knowledge|history).{0,35}\bevidence\b/is, - ]), - 'Grounded first principles types only consequential premises and retains revision and stopping conditions', - ); - check( - hasAll(skill, [ - /Practice-led principal-contradiction analysis/i, - /dominant aspect/i, - /secondary.{0,15}(?:coupl|factor|effect)/is, - /(?:revisable|tentative|provisional).{0,35}(?:hypothesis|prioritization|ranking)/is, - /(?:condition|observation).{0,45}(?:reorder|reprioriti|change the ranking)/is, - /(?:not|never|does not).{0,45}(?:authorize|permit).{0,35}production/is, - /(?:not|never|do not).{0,55}(?:universal|single.cause|doctrine)/is, - ]), - 'Principal-contradiction analysis remains revisable, coupled, practical, and non-doctrinal', - ); - check( - hasAll(skill, [ - /Material history or genealogy/i, - /(?:clarif|explain|illuminate).{0,20}(?:present|current)/is, - /prior arrangement/i, - /emergence|adoption/i, - /discontin|rupture|break/i, - /(?:caus\w*.{0,35}(?:interpret|tentative|label)|(?:interpret|tentative|label).{0,35}caus\w*)/is, - /(?:reject|not|never).{0,55}(?:inevitab|present-purpose|predetermin)/is, - /(?:interacting|multiple|combined).{0,20}causes?/is, - /source|evidence/i, - ]), - 'Material history uses sourced, discontinuous, interacting causality without inevitability', - ); - check( - hasAll(skill, [ - /Reciprocal Socratic questioning/i, - /either participant/i, - /reject.{0,20}premise/is, - /Agent.{0,20}answer|answer.{0,20}Agent/is, - /aporia|unresolved|open question/i, - /questions?.{0,35}(?:yield|give way|stop)/is, - /(?:direct|plain).{0,20}(?:explanation|answer)|admit.{0,15}uncertainty/is, - ]), - 'Socratic questioning is reciprocal, answerable, and yields instead of manufacturing assent', - ); - check( - hasAll(skill, [ - /Minimal structural box-drawing/i, - /(?:few|small number of).{0,35}(?:boxes|elements)/is, - /abstraction level/i, - /structural inference.{0,35}(?:cheaper|easier|clearer).{0,20}prose/is, - /(?:check|compare).{0,70}(?:sources|code|examples|participants' model)/is, - /(?:revise|discard).{0,45}(?:not help|unhelpful|fails)/is, - ]), - 'Box-drawing serves one checked inference and is discarded when unhelpful', - ); - check( - hasAll(skill, [ - /(?:correct|counter|check|friction)/i, - /hard constraints?.{0,50}history/is, - /questions?.{0,50}(?:answer|reciprocal)/is, - /diagrams?.{0,50}(?:prose|source|practice)/is, - ]), - 'Learn Skill keeps cross-lens corrective friction visible without mandatory pairings', - ); - check( - hasAll(skill, [ - /(?:do not|never|must not)\s+introduce/i, - /entry command/i, - /fixed encounter stages|stage sequence/i, - /required\s+transcript|transcript requirement/i, - /transcript or summary|summary requirement|mandatory summary/i, - /mandatory headings/i, - /\bscore\b/i, - /\bmetric\b/i, - /completion gate/i, - /approval ceremony/i, - /per-edit human approval/i, - /parsed body schema/i, - /second task system/i, - ]), - 'Learn Skill rejects protocol, schema, assessment, and approval machinery', - ); - for (const behavior of prohibitedSkillBehaviors) { - check( - !detectsProhibitedBehavior(skill, behavior), - `Learn Skill contains no contradictory ${behavior.key} claim`, - ); - } - assertContradictoryRegressionFixtures(check); -} - -export function runLearnTests(check: LearnCheck): void { - console.log('--- Learn distribution and contract'); - - const expectedFiles = [...learnFiles].sort(); - check( - JSON.stringify(filesBelow(path.join(sourceRoot, 'templates', '.omp-flow', 'learn'))) === JSON.stringify(expectedFiles), - 'canonical Learn skeleton contains exactly four indexes', - ); - const canonicalSkill = read(sourceRoot, 'templates/common/skills/omp-flow-learn/SKILL.md'); - for (const destination of skillDestinations) { - check(canonicalSkill === read(sourceRoot, destination), `${destination} is byte-identical to the canonical Learn Skill`); - } - for (const harness of ['codex', 'snow', 'cursor'] as const) { - check(!fs.existsSync(path.join(sourceRoot, `.${harness}`, 'skills')), `tracked project has no ${harness}-specific Skill tree`); - } - - const managed = getManagedResources(['omp', 'codex', 'claude', 'snow', 'cursor']); - for (const relativePath of learnFiles) { - const destination = `.omp-flow/learn/${relativePath}`; - const matches = managed.filter(resource => resource.destinationPath.split(path.sep).join('/') === destination); - check(matches.length === 1 && matches[0]?.group === 'core', `${destination} is registered once as a core resource`); - } - for (const destination of skillDestinations) { - const matches = managed.filter(resource => resource.destinationPath.split(path.sep).join('/') === destination); - check(matches.length === 1, `${destination} is registered once through normal Skill mapping`); - } - check( - managed.every(resource => !/[\\/](?:\.codex|\.snow|\.cursor)[\\/]skills[\\/]omp-flow-learn/.test(path.join(path.sep, resource.destinationPath))), - 'managed resources contain no Codex, Snow, or Cursor Learn Skill duplicate', - ); - - const installedRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'omp-flow-learn-test-')); - try { - deployInitResources({ cwd: installedRoot, harnesses: ['omp', 'codex', 'claude', 'snow', 'cursor'] }); - check( - JSON.stringify(filesBelow(path.join(installedRoot, '.omp-flow', 'learn'))) === JSON.stringify(expectedFiles), - 'fresh install receives exactly the four-file Learn skeleton', - ); - for (const relativePath of learnFiles) { - check( - read(sourceRoot, `templates/.omp-flow/learn/${relativePath}`) === read(installedRoot, `.omp-flow/learn/${relativePath}`), - `fresh ${relativePath} is byte-identical to canonical`, - ); - } - for (const destination of skillDestinations) { - check(canonicalSkill === read(installedRoot, destination), `fresh ${destination} is byte-identical to canonical`); - } - for (const harness of ['codex', 'snow', 'cursor'] as const) { - check(!fs.existsSync(path.join(installedRoot, `.${harness}`, 'skills')), `fresh install has no ${harness}-specific Skill tree`); - } - } finally { - fs.rmSync(installedRoot, { recursive: true, force: true }); - } - - assertIndexContract(check); - assertSkillContract(canonicalSkill, check); -} diff --git a/tests/omp-flow.test.ts b/tests/omp-flow.test.ts index ab72629b..40d284be 100644 --- a/tests/omp-flow.test.ts +++ b/tests/omp-flow.test.ts @@ -6,7 +6,7 @@ import path from 'node:path'; import { renderCliBanner, supportsBannerColor } from '../src/cli/banner.js'; import { deployInitResources, getManagedResources } from '../src/cli/init.js'; -import { analyzeChanges } from '../src/cli/update.js'; +import { analyzeChanges, executeUpdate } from '../src/cli/update.js'; import { loadHashes } from '../src/cli/template-hash.js'; import { OMPFlowExtension } from '../src/omp/extension.js'; import { runFlowStatusSetupTests } from './flow-status-v2-setup.test.js'; @@ -14,7 +14,6 @@ import { runFlowStatusV2PublisherTests } from './flow-status-v2-publisher.test.j import { runFlowStatusV2SupervisorTests } from './flow-status-v2-supervisor.test.js'; import { runCodexInitTests } from './codex-init.test.js'; import { runInitCLITests } from './init-cli.test.js'; -import { runLearnTests } from './learn.test.js'; import { runOMPFlowStatusTests } from './omp-flow-status.test.js'; import { runSnowCursorManagedResourceTests } from './snow-cursor-managed-resources.test.js'; @@ -158,7 +157,6 @@ try { check(!supportsBannerColor({ NO_COLOR: '' }, true), 'NO_COLOR disables banner color'); check(supportsBannerColor({ FORCE_COLOR: '1' }, false), 'FORCE_COLOR enables banner color'); await runInitCLITests(check); - runLearnTests(check); await runSnowCursorManagedResourceTests(check); runCodexInitTests(check); execFileSync(python, ['-X', 'utf8', path.join(sourceRoot, 'tests', 'wiki-sleep.test.py')], { @@ -200,6 +198,31 @@ try { 'Workflow temporary installation is byte-identical', ); + const workflowLibraryFiles = [ + 'index.md', + 'full-delivery.md', + 'lite.md', + 'research.md', + 'experiment.md', + 'workflow-maintenance.md', + ] as const; + for (const fileName of workflowLibraryFiles) { + const canonical = fs.readFileSync( + path.join(sourceRoot, 'templates', '.omp-flow', 'workflow', fileName), + 'utf8', + ); + check( + fs.readFileSync(path.join(root, '.omp-flow', 'workflow', fileName), 'utf8') === canonical, + `Workflow Library temporary installation is byte-identical for ${fileName}`, + ); + } + + check( + workflowLibraryFiles.includes('index.md') && + fs.readFileSync(path.join(root, '.omp-flow', 'workflow', 'index.md'), 'utf8').includes('research.md'), + 'Workflow Library index exposes authored workflow choices', + ); + const sharedSkillNames = [ 'omp-flow', 'omp-flow-brainstorm', @@ -208,6 +231,7 @@ try { 'omp-flow-qbd', 'omp-flow-decompose', 'omp-flow-implement', + 'omp-flow-workflow-maintainer', 'omp-flow-check', ] as const; const sharedSkillText: Record = {}; @@ -1017,23 +1041,6 @@ try { && json<{ taskId: string }>(root, ['task', 'current']).taskId === created.taskId, 'active task selection is session isolated', ); - const localSelection = json<{ taskId: string; contextKey: string }>( - root, - ['task', 'select', created.taskId], - null, - ); - check( - localSelection.taskId === created.taskId && localSelection.contextKey.startsWith('local-'), - 'task selection remains available when a Harness shell exposes no session identity', - ); - check( - json<{ taskId: string }>(root, ['task', 'current'], null).taskId === created.taskId, - 'the repository-local terminal lane reads back its selected task', - ); - check( - json(root, ['operation', 'list', '--task', created.taskId], 'other').length === 0, - 'an explicit task takes precedence over another selected task', - ); failure(root, ['task', 'show', '..'], 'Task path escapes task root'); failure( root, @@ -1522,6 +1529,34 @@ try { console.log('--- update and Hook boundary'); const plan = analyzeChanges(root, loadHashes(root)); check(plan.every(item => item.status === 'unchanged'), 'fresh install is unchanged under update analysis'); + + const migrationRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'omp-flow-migration-')); + fs.cpSync(root, migrationRoot, { recursive: true }); + for (const fileName of workflowLibraryFiles) { + fs.rmSync(path.join(migrationRoot, '.omp-flow', 'workflow', fileName), { force: true }); + } + fs.rmSync(path.join(migrationRoot, '.omp-flow', '.template-hashes.json'), { force: true }); + const migrationPlan = analyzeChanges(migrationRoot, {}); + check( + workflowLibraryFiles.every(fileName => { + const item = migrationPlan.find( + candidate => candidate.relativePath === `.omp-flow/workflow/${fileName}`, + ); + return item?.status === 'new' && item.action === 'create'; + }), + 'legacy project update creates missing Workflow Library files', + ); + executeUpdate(migrationRoot, migrationPlan, {}); + check( + workflowLibraryFiles.every(fileName => + fs.statSync(path.join(migrationRoot, '.omp-flow', 'workflow', fileName)).isFile(), + ), + 'legacy project update writes every missing Workflow Library file', + ); + check( + migrationPlan.find(item => item.relativePath === '.omp-flow/workflow.md')?.status === 'unchanged', + 'legacy full-delivery Workflow remains available during migration', + ); const guard = spawnSync( python, ['-X', 'utf8', path.join(root, '.claude', 'hooks', 'protect-runtime.py')],