diff --git a/AGENTS.md b/AGENTS.md index c2bdac6..d9872c1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,6 +16,8 @@ **Competing-PR coverage is not established by existence or passing tests.** For every VSM-derived/informed Upgrade hypothesis, use [the function-ownership/overlap receipt](PROTOCOL.md#existing-work-functional-overlap-and-vsm-ownership-gate): pin historical assessment plus current original source and competing PR head/diff, identify the decisive VSM decision owner and closure, compare matched native cases, and explicitly assess the remaining user task. An S2 tab router, static limit, or health check is not S3; current-task retry or accumulated helpers is not S4. Evaluate continuation/dependent work before opening a duplicate, but never mutate another author's PR branch or post to an external repo without the separate exact public consent. A partial/uncertain overlap does not close the single-harness search; preserve `EVIDENCE_INSUFFICIENT` where functional proof is absent. +**Explicit experimental target dispatch:** Named `upstream roadmap OWNER/REPO --target A` / `--target P` follows [the experimental extension](docs/EXPERIMENTAL_ROADMAP_TARGETS.md), local draft-only. C (including explicit --target C) remains the ordinary full cycle. Experimental dispatch takes precedence over named default persistence/outreach rules; keep accepted Index, six-function census, Track A/B, rights and consent gates. Never relabel P/A as C or count an experiment as a canonical case. + **Unspecified `upstream roadmap` / `upstream roadmap select` — Index-first discovery:** First use [scripts/roadmap_select.py](scripts/roadmap_select.py) to pin the accepted included Index cohort and produce source-native candidates; verify original repo/license/contributor formalities, issue bodies, competing PR heads, fork parent, owner PAUSE/STOP, live original head and prior roadmap before locking one original. `select` is read-only research leads only. Unnamed `upstream roadmap` continues from the first source-validated qualified original into the normal named full cycle, with no automatic publication. Missing grades and matching issue titles are not demonstrated C needs, and a ranking is not a scheduler or new contribution. [Selection protocol](PROTOCOL.md#index-first-upstream-roadmap-selection-unspecified-source-read-only-lead-screen) · [existing case view](scripts/roadmap_view.py). **Mandatory accepted Index assessment gate:** Before **any named Upstream roadmap, upgrade, original-specific batch decision, code implementation or public fork/original publication**, read back an accepted `status: included` standalone general assessment and matching `data/catalog.psv` identity/`review_ref` for the exact original in a pinned `opensiro/vsm-harness-index` commit. Record accepted blob/Index SHAs, review date, Profile/Methodology and current original HEAD. A proposed PR, excluded record, predecessor vector or `.opensiro` draft does **not** qualify. If absent: `ASSESSMENT_REQUIRED / BLOCKED`; only lawful intake/source preflight and owning Index assessment/admission are allowed. Re-run roadmap after canonical Index admission and readback. See [mandatory protocol](PROTOCOL.md#mandatory-accepted-assessment-prerequisite--fail-closed). diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f56b1..a75c26d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ## Unreleased +- **Experimental A/P Roadmap targets:** Explicit named opt-in local draft route with target-family/mode-preservation checks and Human/AI templates; C remains the unchanged default. Experimental drafts cannot pass production case/publication gates. See [experimental extension](docs/EXPERIMENTAL_ROADMAP_TARGETS.md). + - **Native Idea feature-request form (PATCH, 2026-11-26):** Recognize a first-party YAML feature_request/feature-request form explicitly named Idea (Filament); retain declared-name checks, required fields, ambiguous-channel and exact consent gates. A filename alone or an unrelated Idea form does not establish a feature route. - **Verified template-free native Issue route (PATCH, 2026-11-26):** Recognize a blank Issue only after pinned local/inherited configuration and legacy template checks plus GitHub GraphQL confirmation of an empty effective template list, enabled Issues and matching default HEAD. Preserve unknown/forbidden channel, original payload, history, PAUSE and exact consent gates. diff --git a/PROTOCOL.md b/PROTOCOL.md index 22716f8..30430c8 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -67,6 +67,8 @@ Example: `python3 scripts/validate_public_issue_payload.py --kind fork --case-di 4. Check native **need, mechanism, counterfactual and scope**. Unsupported claims remain pending. No mandatory six-function S1–S5 scan or per-session batch. 5. Before implementation, apply the [material capability-delta gate](#material-capability-delta-gate-before-implementation). An Index link, a new configuration flag, a passing unit test or an absence in a VSM function vector is not independently a useful Upgrade. +**Experimental target dispatch (opt-in):** Named `upstream roadmap OWNER/REPO --target A` or `--target P` uses [Experimental Capability Roadmap targets](docs/EXPERIMENTAL_ROADMAP_TARGETS.md) and its local draft-only boundary instead of production C persistence/publication. Unqualified or explicit C remains the existing route. No change to Index admission, legal/owner control, default selection or public consent. + ## Mandatory Roadmap case-write Human/AI template gate **Every new or materially revised canonical Roadmap case MUST pass both validators before writing its fork-local `opensiro/meta` commit, not only before an external PR.** This includes new source-first runs, independent reruns, reopened cases, evidence-driven decision revisions and Human/AI refinements after a protocol patch. Before the write, verify the matching fork and owner control, select the existing stable `.opensiro/issues//` (deduplicate rather than create a parallel case), and assemble the complete `README.md`, Human `issue.md`, AI `constructor-sufficiency.md` and canonical `roadmap.md` together. Use the **current main-branch** [Human template](templates/FORK_CAPABILITY_ROADMAP_ISSUE.md) (eight numbered sections) and [AI template](templates/ROADMAP_AI_CONSTRUCTOR_CONTRACT.md) (six numbered sections). The proposal receipt remains the sole source of accepted historical vector, target, priorities, decision and research disposition. diff --git a/README.md b/README.md index a137264..ea384b1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Upstream is the **operational S1 domain** of [OpenSiro VSM OSS](https://github.c **Protocol:** [v0.18.3](VERSION) · [How work proceeds](PROTOCOL.md) · [Fork metadata](docs/FORK_METADATA.md) · [Architecture](docs/ARCHITECTURE.md) · [History](CHANGELOG.md) · [Releases](https://github.com/opensiro/upstream/releases) +**Experimental explicit targets:** `upstream roadmap OWNER/REPO --target P` or `--target A` selects a [local draft-only experimental extension](docs/EXPERIMENTAL_ROADMAP_TARGETS.md). C remains the default; no experimental canonical case write or external publication. + ## Command navigation — choose the owning read-only projection first | User intent / examples | Route and first tool | What it answers | diff --git a/docs/CAPABILITY_ROADMAP.md b/docs/CAPABILITY_ROADMAP.md index f53871d..4d2e802 100644 --- a/docs/CAPABILITY_ROADMAP.md +++ b/docs/CAPABILITY_ROADMAP.md @@ -62,6 +62,8 @@ This is a qualitative prioritization **not an Index reassessment, six-feature qu **Reporting handoff:** Store the complete independent run and verdict only in its matched fork-local case; a completed Roadmap run does **not** warrant a separate Upstream PR or `.md` report. Use the existing coordination Issue for concise state pointers and, if needed, the [single Roadmap report's Supplementary section](ROADMAP_REPORT.md#supplementary) for historical links. Close unneeded report-only PRs without merging case summaries into Upstream; genuine shared-method changes use normal reviewed PRs. This is reporting hygiene, not a new C-admission criterion or metric. +**Experimental opt-in only:** Explicit named `--target P` / `--target A` proposals follow the [experimental target extension](EXPERIMENTAL_ROADMAP_TARGETS.md), with the same source-first research and local draft validation. Everything below remains the production C contract; C is the default. + ## Default target and work priority ### Proposal-first decision boundary (required) diff --git a/docs/EXPERIMENTAL_ROADMAP_TARGETS.md b/docs/EXPERIMENTAL_ROADMAP_TARGETS.md new file mode 100644 index 0000000..3bb1d8f --- /dev/null +++ b/docs/EXPERIMENTAL_ROADMAP_TARGETS.md @@ -0,0 +1,81 @@ +# Experimental Capability Roadmap targets — P and A + +**EXPERIMENTAL · EXPLICIT OPT-IN · PLAN_ONLY · LOCAL DRAFT ONLY.** + +This is an experimental extension of [Capability Roadmap](CAPABILITY_ROADMAP.md), not a separate methodology, a new classification, a release, a scheduled cohort or a change to the ordinary C route. + +## Command dispatch + +These are conversational commands, not implemented Upstream CLI subcommands. + +| Invocation | Route | +| --- | --- | +| `upstream roadmap`, `upstream roadmap OWNER/REPO`, `upstream roadmap OWNER/REPO --target C` | Existing production C Roadmap; all existing selection, persistence and publication gates remain unchanged. | +| `upstream roadmap OWNER/REPO --target P` | Explicit experimental P-family, one named original, local draft only. | +| `upstream roadmap OWNER/REPO --target A` | Explicit experimental A-family, one named original, local draft only. | + +Unspecified-source selection, independent rerun cohort, Upgrade, portfolio statistics and all existing canonical cases remain C-route compatible. P/A experiments require a named original and explicit family selection; do not silently fall back to C or change targets after locking the original. Unknown targets and unnamed P/A requests do not start an experiment. No automatic experiment in a default or queue-driven invocation. + +## Same Roadmap methodology; different target sufficiency + +Follow the same current [protocol](../PROTOCOL.md), accepted Index prerequisite, license/formality checks, verified current original source and existing owner PAUSE/STOP boundaries. Separate the accepted historical Index vector from current source findings. Apply the whole-repository six-function census, neutral target ranking, Track A (shipped code, native workarounds, Issues, PR heads) and independent Track B (minimum complete on-top native change) on the same task and revision. Select one function after comparing plausible candidates; keep P0/P1/P2 and Human/AI/canonical receipt aligned. No target from a missing historical grade alone; inspect current source and resolve material unknowns. No requirement to maximize autonomy, create all six functions, or first create C before A. + +- **A family:** propose a function-specific, complete first-party standard-distribution operating mode in which an autonomous agent owns the decisive choice/feedback right, has legitimate authority and relevant information, and closes it through actual subsequent operation. Configuration, model/provider selection and a compatible external runtime may remain user-provided; the developer must not still need to construct the decisive autonomous actor, authority or material closure loop. Generic automation or code examples are insufficient. Eligible functions follow Skills; accepted Index admission remains mandatory, including S1 inclusion rules. +- **P family:** propose a distinct, function-specific first-party parent-governed mode for **S3, S4 or S5 only**, with a legitimate parent decision owner at the declared recursion, information channel, authoritative choice, returned decision and effect/feedback. An ordinary approval, kill switch, config edit or external oversight alone is not P. Do not equate any parent decision with S5. +- Apply the actual function-specific Profile witness, not a generic actor checklist: e.g. S2 inter-S1 interference, S3 whole-system current regulation, S3* independent complementary evidence, S4 prospective environment and two-way S3 conversation, S5 legitimate ultimate policy. Cite the applicable pinned Skills Methodology, do not redefine states. + +## Target transition and preservation + +The family is the requested new ownership mode, not necessarily the final notation. Record exact historical state -> proposed after-state for the same function and the independently reconstructed current state. Example: historical S4=—, current S4=C, requested P with preservation means `S4=— -> S4=C(P)`. + +| Observed current mode | A family, preserving modes | P family, preserving modes | +| --- | --- | --- | +| — | A | P (eligible functions only) | +| C | A | C(P) | +| P | A(P) | Already established | +| C(P) | A(P) | Already established | +| A | Already established | A(P) | +| A(P) | Already established | Already established | + +Preserve independent modes by default. A hypothetical replacement may target standalone A or P only with explicit source-grounded rationale and prospective legitimate authority; no replacement, revocation or grant occurs during Roadmap. For A, retaining an existing C interface is an engineering compatibility question, not a new autonomy modifier. A(P)/C(P) require independently supported mode-specific witnesses and reconstructable ownership in each actual run, not shared simultaneous authority or exceptional human intervention alone. Record trigger/mode selection, decision owner, rights, return, conflicts and preservation. Check cross-function and cross-recursion compatibility (S5=A does not automatically require S3/S4=A; parent S3/S4 does not imply S5=P). Escalation of reserved S5 matters is not parent ownership of another function by itself. + +For each eligible proposed mode provide a concrete observed or hypothetical application scenario, source-native alternatives, complete proposed chain, precise falsifier, and positive/negative acceptance tests. Discuss expected benefits and matched costs as hypotheses, NOT_MEASURED. Use source-grounded design GO + NEEDS_EVIDENCE when appropriate; do not impose proven benefit, product demand or maintainer agreement as an extra GO criterion. NO_GO is scoped to equivalent target ownership already established, incoherent/incomplete construction, binding impossibility or justified absence of a qualified target. BLOCKED is for an indispensable unresolved fact after permitted attempts, with owner/unlock. Distinguish hypothetical legitimate authority construction from an operative grant. No proposal-stage assessment changes or native test success. + +## Experimental case draft + +Use the usual four filenames **locally**, as a single experimental draft, not a parallel canonical case. Reuse the standard receipt's nine sections and Parallel contribution-on-top review; fill all current proposal-gate fields except replace `Proposed C construction` and `C sufficiency falsifier` with `Proposed target construction` and `Target sufficiency falsifier`. Use these explicit receipt fields: + +```text +- Receipt contract: experimental-proposal-gate +- Target family: A +- Target transition: S4=— -> S4=A +- Current selected function state: — +- Mode preservation: PRESERVE +- Mode rationale: +- Prospective authority: +- Cross-function authority compatibility: +``` + +These example values are illustrative, not assessed evidence. With no qualified target use `NO_QUALIFIED_A_TARGET` or `NO_QUALIFIED_P_TARGET`, NO_GO, current NONE, preservation NOT_APPLICABLE, and explain the census/authority disposition. With a material unresolved current state use ?, BLOCKED, preservation UNRESOLVED and name the missing fact; do not guess a positive state. For a selected resolved state use PRESERVE or REPLACE, with mode rationale. The target family, current state, preservation, prospective authority, cross-function compatibility, target transition and both verdicts must match the receipt in Human and AI. + +- README.md links the three other files, pinned source/Index and original identity, explicitly marks EXPERIMENTAL — DRAFT ONLY. +- Human `issue.md`: [experimental eight-section template](../templates/EXPERIMENTAL_ROADMAP_HUMAN.md). +- AI `constructor-sufficiency.md`: [experimental six-section template](../templates/EXPERIMENTAL_ROADMAP_AI.md); stable filename retained for compatibility, not a claim of C. +- `roadmap.md`: canonical decision receipt **within this local experiment only**, same historical pins, source map, six dispositions, P0/P1/P2, decision, proposed validation and source-backed limitations. + +Validate locally: + +```sh +python3 scripts/validate_experimental_roadmap.py --target A /path/to/case-dir +python3 scripts/validate_experimental_roadmap.py --target P /path/to/case-dir +``` + +Only run the command matching the selected family. PASS is structural draft validation, not semantic review, verified persistence or public approval. Production `validate_capability_roadmap.py` and `validate_roadmap_publication.py` must reject experimental receipts. Never relabel an experiment as C to bypass production checks. + +## Experiment boundary and handoff + +The opt-in is initially limited to local PLAN_ONLY drafts because canonical persistence, history/lineage, selector/portfolio and native/public payload paths are still C-specific. Do not create a fork, write a canonical case to `opensiro/meta`, open public fork/original Issues/comments/PRs/Discussions, request publication approval or enter production statistics on the experimental route. No additional registry, per-run files in Upstream, contribution record, product implementation, release or change of ownership. Honor explicit PAUSE/STOP and legal constraints. A local draft may inspect the existing verified fork read-only and reference prior cases. + +Report the complete Human proposal, technical companion and receipt, validation result, recommended outreach (if justified, unapproved local draft only) and explicit `EXPERIMENTAL_DRAFT_ONLY / NOT_PERSISTED / NOT_READY_FOR_EXTERNAL_PROPOSAL`; note the promotion blocker. No automatic public action even with an ordinary C approval. Promotion requires a separately reviewed target-aware integration of canonical case persistence, selectors/reporting, history/lineage and exact public payload gates, plus unchanged per-action owner consent. No external interaction is authorized by this experimental extension. + +Related: [Organization #346](https://github.com/opensiro/vsm-oss-organization/issues/346), [#347](https://github.com/opensiro/vsm-oss-organization/issues/347), [#348](https://github.com/opensiro/vsm-oss-organization/issues/348). diff --git a/scripts/validate_capability_roadmap.py b/scripts/validate_capability_roadmap.py index 3247a00..d49366a 100644 --- a/scripts/validate_capability_roadmap.py +++ b/scripts/validate_capability_roadmap.py @@ -61,7 +61,74 @@ def parse_vector(vector: str) -> dict[str, str] | None: return out -def validate(contents: str) -> list[str]: +EXPERIMENTAL_CONTRACT = "experimental-proposal-gate" +EXPERIMENTAL_TARGETS = ("A", "P") +EXPERIMENTAL_FIELDS = ( + "Target family", "Current selected function state", "Mode preservation", + "Prospective authority", "Cross-function authority compatibility", +) + + +def experimental_transition_errors(contents: str, target: str) -> list[str]: + """Check proposed ownership transition; never attest source truth or authority.""" + errors = [] + if value(contents, "Target family") != target: + errors.append("experimental Target family must match explicit target") + transition = value(contents, "Target transition") + decision = value(contents, "Proposal-stage decision") + current = value(contents, "Current selected function state") + preservation = value(contents, "Mode preservation") + if transition == f"NO_QUALIFIED_{target}_TARGET": + if decision != "NO_GO" or current != "NONE" or preservation != "NOT_APPLICABLE": + errors.append("experimental no-target requires NO_GO, NONE current, NOT_APPLICABLE mode preservation") + return errors + match = re.fullmatch( + r"(S1|S2|S3\*|S3|S4|S5)=(—|\?|A|C|P|A\(P\)|C\(P\))\s*->\s*" + r"(S1|S2|S3\*|S3|S4|S5)=(A|P|A\(P\)|C\(P\))", + transition or "", + ) + if not match or match[1] != match[3]: + return errors + ["invalid experimental Target transition: same function required"] + fn, before, _, after = match.groups() + vector = parse_vector(value(contents, "Accepted VSM vector") or "") + if vector and vector[fn] != before: + errors.append("Target transition disagrees with accepted historical VSM vector") + if (target == "A" and after not in ("A", "A(P)")) or ( + target == "P" and after not in ("P", "A(P)", "C(P)") + ): + errors.append("transition does not match experimental Target family") + parent_eligible = fn in ("S3", "S4", "S5") + if not parent_eligible and (target == "P" or "P" in after or "P" in (current or "")): + errors.append("parent mode is allowed only for S3, S4, S5") + if current not in STATES: + errors.append("invalid Current selected function state") + return errors + if current == "?": + if decision != "BLOCKED" or preservation != "UNRESOLVED": + errors.append("unresolved current state requires BLOCKED and UNRESOLVED mode preservation") + return errors + # Current source, not historical grades, determines whether a mode is added. + # An already-established target may be a scoped NO_GO, not a new GO. + existing_a = current in ("A", "A(P)") + existing_p = current in ("P", "A(P)", "C(P)") + if decision == "GO" and ((target == "A" and existing_a) or (target == "P" and existing_p)): + errors.append("GO cannot propose an already established target mode") + if preservation not in ("PRESERVE", "REPLACE"): + errors.append("resolved mode preservation must be PRESERVE or REPLACE") + if preservation == "PRESERVE": + expected = ("A(P)" if existing_p else "A") if target == "A" else ( + "A(P)" if existing_a else "C(P)" if current in ("C", "C(P)") else "P" + ) + if after != expected: + errors.append("target transition conflicts with preserved current modes") + if preservation == "REPLACE" and after != target: + errors.append("REPLACE must target standalone A or P") + if not value(contents, "Mode rationale"): + errors.append("missing Mode rationale: source-grounded preservation or hypothetical replacement") + return errors + + +def validate(contents: str, *, experimental_target: str | None = None) -> list[str]: errors = [] for section in SECTIONS: if not re.search(r"^## "+re.escape(section)+r"\s*$", contents, re.M): @@ -82,17 +149,24 @@ def validate(contents: str) -> list[str]: if actual and not pattern.fullmatch(actual): errors.append("invalid format: "+field) on_top = value(contents, "Receipt contract") - if on_top in ("contribution-on-top", "proposal-gate"): + if experimental_target is not None: + if experimental_target not in EXPERIMENTAL_TARGETS or on_top != EXPERIMENTAL_CONTRACT: + return errors + ["explicit experimental A/P target requires experimental-proposal-gate"] + elif on_top == EXPERIMENTAL_CONTRACT or value(contents, "Target family") in EXPERIMENTAL_TARGETS: + return errors + ["experimental A/P receipt is not a production C Roadmap"] + if on_top in ("contribution-on-top", "proposal-gate", EXPERIMENTAL_CONTRACT): if not re.search(r"^## Parallel contribution-on-top review\s*$", contents, re.M): errors.append("missing section: Parallel contribution-on-top review") for key in ("Evaluation object", "Existing-work overlap", "Our on-top contribution", "Incremental benefit", "Decision scope"): if not value(contents, key): errors.append("missing field: " + key) - if on_top == "proposal-gate": + if on_top in ("proposal-gate", EXPERIMENTAL_CONTRACT): for key in ("Repository-wide source map", "Priority rationale", "Accepted VSM vector", "Target transition", "P1 dependencies", - "P2 optional", "Proposed C construction", "C sufficiency falsifier", + "P2 optional", + "Proposed target construction" if experimental_target else "Proposed C construction", + "Target sufficiency falsifier" if experimental_target else "C sufficiency falsifier", "Scenario basis", "Proposal-stage decision", "Research disposition", "Proposed validation", "Validation state", "Proposal falsifier"): if not value(contents, key): @@ -107,7 +181,12 @@ def validate(contents: str) -> list[str]: if disposition and disposition not in ("DECISION_READY", "NEEDS_EVIDENCE", "NO_USEFUL_CHANGE"): errors.append("invalid Research disposition") transition = value(contents, "Target transition") - if transition == "NO_QUALIFIED_C_TARGET": + if experimental_target: + for key in EXPERIMENTAL_FIELDS: + if not value(contents, key): + errors.append("missing experimental field: " + key) + errors.extend(experimental_transition_errors(contents, experimental_target)) + elif transition == "NO_QUALIFIED_C_TARGET": if value(contents, "Proposal-stage decision") != "NO_GO": errors.append("NO_QUALIFIED_C_TARGET requires NO_GO") elif transition: @@ -157,7 +236,7 @@ def display_value(text: str, label: str) -> str | None: return m.group(1).strip().strip("`") if m else None -def validate_case_dir(directory: Path) -> list[str]: +def validate_case_dir(directory: Path, *, experimental_target: str | None = None) -> list[str]: """Structural consistency: three public-source case files, no GitHub lookups.""" needed = {name: directory / name for name in ("roadmap.md", "issue.md", "constructor-sufficiency.md")} @@ -166,17 +245,20 @@ def validate_case_dir(directory: Path) -> list[str]: if errors: return errors receipt = needed["roadmap.md"].read_text(encoding="utf-8") - errors.extend(validate(receipt)) - if value(receipt, "Receipt contract") != "proposal-gate": + errors.extend(validate(receipt, experimental_target=experimental_target)) + expected_contract = EXPERIMENTAL_CONTRACT if experimental_target else "proposal-gate" + if value(receipt, "Receipt contract") != expected_contract: return errors # grandfather historical read-only receipts human = needed["issue.md"].read_text(encoding="utf-8") ai = needed["constructor-sufficiency.md"].read_text(encoding="utf-8") for name, body in (("issue.md", human), ("constructor-sufficiency.md", ai)): if "[roadmap.md](roadmap.md)" not in body: errors.append(name + " must link canonical roadmap.md") - for label, key in (("Target transition", "Target transition"), - ("Proposal-stage decision", "Proposal-stage decision"), - ("Research disposition", "Research disposition")): + keys = ("Target transition", "Proposal-stage decision", "Research disposition") + if experimental_target: + keys += EXPERIMENTAL_FIELDS + for key in keys: + label = key observed = display_value(body, label) expected = value(receipt, key) if observed is None: diff --git a/scripts/validate_experimental_roadmap.py b/scripts/validate_experimental_roadmap.py new file mode 100644 index 0000000..c40a357 --- /dev/null +++ b/scripts/validate_experimental_roadmap.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Structural draft-only validation of explicit A/P Roadmap experiments.""" +from __future__ import annotations + +import argparse +from pathlib import Path + +from validate_roadmap_publication import check_case_structure + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--target", required=True, choices=("A", "P")) + parser.add_argument("case_dir", type=Path) + args = parser.parse_args(argv) + errors = check_case_structure(args.case_dir, experimental_target=args.target) + if errors: + for error in errors: + print("EXPERIMENTAL_DRAFT_INVALID: " + error) + return 1 + print("EXPERIMENTAL_DRAFT_STRUCTURE_PASS — NOT PERSISTENCE OR PUBLICATION APPROVAL") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/validate_roadmap_publication.py b/scripts/validate_roadmap_publication.py index cf79dba..66befb9 100644 --- a/scripts/validate_roadmap_publication.py +++ b/scripts/validate_roadmap_publication.py @@ -146,12 +146,13 @@ def unfilled_placeholders(body: str, filename: str) -> list[str]: return errors -def check_publication_ready(case_dir: Path) -> list[str]: +def check_case_structure(case_dir: Path, *, experimental_target: str | None = None) -> list[str]: + """Shared Human/AI structure. Experimental use is draft-only, never publication readiness.""" errors = [f"missing required roadmap case file: {n}" for n in REQUIRED_FILES if not (case_dir / n).is_file()] if errors: return errors - errors.extend(validate_case_dir(case_dir)) + errors.extend(validate_case_dir(case_dir, experimental_target=experimental_target)) human = (case_dir / "issue.md").read_text(encoding="utf-8") ai = (case_dir / "constructor-sufficiency.md").read_text(encoding="utf-8") readme = (case_dir / "README.md").read_text(encoding="utf-8") @@ -160,10 +161,28 @@ def check_publication_ready(case_dir: Path) -> list[str]: if not body.lstrip().startswith("# "): errors.append(f"{name}: document title missing") errors.extend(unfilled_placeholders(body, name)) - errors.extend(headings_match(human, TEMPLATE / "FORK_CAPABILITY_ROADMAP_ISSUE.md", "issue.md")) - errors.extend(headings_match(ai, TEMPLATE / "ROADMAP_AI_CONSTRUCTOR_CONTRACT.md", "constructor-sufficiency.md")) - errors.extend(required_labels(human, HUMAN_LABELS, "issue.md")) - errors.extend(required_labels(ai, AI_LABELS, "constructor-sufficiency.md")) + if experimental_target: + human_template = "EXPERIMENTAL_ROADMAP_HUMAN.md" + ai_template = "EXPERIMENTAL_ROADMAP_AI.md" + human_labels = tuple({ + "Proposed C capability (P0)": "Proposed target capability (P0)", + "Track B — independent on-top C construction": "Track B — independent on-top target construction", + "Proposed C-sufficiency verdict": "Proposed target-sufficiency verdict", + }.get(label, label) for label in HUMAN_LABELS) + ai_labels = tuple("Architectural target-sufficiency argument" if label == "Architectural C-sufficiency argument" else label for label in AI_LABELS) + for name, body in (("issue.md", human), ("constructor-sufficiency.md", ai), ("README.md", readme)): + if "EXPERIMENTAL — DRAFT ONLY" not in body: + errors.append(name + ": missing experimental draft-only marker") + else: + if any("EXPERIMENTAL — DRAFT ONLY" in body for body in (human, ai, readme)): + errors.append("experimental draft cannot enter the production C gate") + human_template = "FORK_CAPABILITY_ROADMAP_ISSUE.md" + ai_template = "ROADMAP_AI_CONSTRUCTOR_CONTRACT.md" + human_labels, ai_labels = HUMAN_LABELS, AI_LABELS + errors.extend(headings_match(human, TEMPLATE / human_template, "issue.md")) + errors.extend(headings_match(ai, TEMPLATE / ai_template, "constructor-sufficiency.md")) + errors.extend(required_labels(human, human_labels, "issue.md")) + errors.extend(required_labels(ai, ai_labels, "constructor-sufficiency.md")) for p in ("**P0:**", "**P1:**", "**P2:**"): if not re.search(r"(?m)^\s*-\s*" + re.escape(p) + r"\s*\S", human): errors.append(f"issue.md: missing populated priority {p}") @@ -190,6 +209,11 @@ def check_publication_ready(case_dir: Path) -> list[str]: return list(dict.fromkeys(errors)) +def check_publication_ready(case_dir: Path) -> list[str]: + """Production C gate; experimental A/P cases always fail closed.""" + return check_case_structure(case_dir) + + def main(argv: list[str] | None = None) -> int: p = argparse.ArgumentParser(description=__doc__) p.add_argument("case_dir", type=Path, help="Complete four-file Roadmap case directory (pre-write draft or verified committed fork copy)") diff --git a/templates/EXPERIMENTAL_ROADMAP_AI.md b/templates/EXPERIMENTAL_ROADMAP_AI.md new file mode 100644 index 0000000..48f94a4 --- /dev/null +++ b/templates/EXPERIMENTAL_ROADMAP_AI.md @@ -0,0 +1,78 @@ +# [HARNESS] — experimental source-native target construction contract + +**EXPERIMENTAL — DRAFT ONLY** · **DRAFT — NOT PUBLISHED** · PLAN_ONLY. +**Canonical decision receipt:** [roadmap.md](roadmap.md) +**Human proposal:** [issue.md](issue.md) +Use current pinned sources only. Do not duplicate the Human six-function vector/table or invent another case. + +## 1. Function-specific construction boundary and methodology checks + +**Source and mode boundary:** [Original HEAD, operating mode, recursion, scope and excluded adjacent systems.] +**Target family:** [A or P from receipt.] +**Target transition:** [Exact receipt transition or NO_QUALIFIED__TARGET.] +**Current selected function state:** [Exact receipt field.] +**Mode preservation:** [Exact receipt field.] +**Prospective authority:** [Exact receipt field.] +**Cross-function authority compatibility:** [Exact receipt field.] +**Six-function dependencies (S1/S2/S3/S3*/S4/S5):** [Relevant dependencies from receipt.] +**Function witness:** [Specific disturbance, decisive owner, information, legitimate authority, enforcement and actual return.] +**Counterfactual owner test:** [Remove proposed decisive owner, retain machinery; what decision remains?] +**Possible methodological negative control:** [Source-backed no-target or parent boundary; falsifier.] +**Contributor / maintainer priorities:** [Attributed optional evidence or NOT_STATED.] + +## 2. Source-pinned baseline and parallel native Track A / on-top Track B + +**Original native workflow:** [Pinned native source, mode, action and outcome.] +**Closest existing solution:** [Matched same-task alternative.] +**Relevant original Issues/PRs:** [Pinned evidence, states and live heads, distinguish shipped from proposed.] + +| Required target link | Track A | Track B | Falsifier | +| --- | --- | --- | --- | +| [Decision, authority, effect and feedback] | [Pinned existing coverage] | [Minimum native delta] | [Counterexample] | + +**On-top distinctness:** [Remaining complete target-mode delta after reuse.] +**Source ambiguity / rights blockers:** [Indispensable fact, owner and unlock or NONE.] + +## 3. Minimal complete [selected function] first-party target construction + +**Required property:** [A: first-party autonomous owner and closed mode; P: legitimate parent-owned function and returned decision path; composite: independent mode witnesses. Function-specific, not generic automation.] + +| Necessary native component or interface | Pinned file/API | Smallest edit | Owner, effect and return | +| --- | --- | --- | --- | +| [Native entry point] | [Evidence] | [Proposed integration] | [Concrete path] | + +**Architectural target-sufficiency argument:** [Compare plausible source-native variants and explain complete chain. Name actual owner, alternatives, legitimate authority, enforcement, return, counterfactual, preserved modes and compatibility; no fixed port count.] +**Explicit non-goals:** [No unrelated functions, production action or authority grant.] +**Implementation dependency graph:** [Prerequisites and native acceptance; no implementation.] + +## 4. Priorities, optional alternative and stopping rules + +**P0 and P1:** [Receipt-derived target and necessary dependencies.] +**P2:** [Optional or NONE.] +**Alternative path:** [Native alternative, retained mode, no construction or separate method question.] +**Stop:** [Scoped no-target, equivalent ownership, incompatibility, legal/authority blocker.] + +## 5. Future source-native acceptance — derive tests, do not copy a matrix + +**Native test commands and entry points:** [Source-backed commands or NOT_RUN / RUNNER_UNAVAILABLE.] +**Positive functional closure:** [Mode-specific decision with observable subsequent effect and feedback.] +**Independent alternative (where applicable):** [Discretion distinguished from enforcement.] +**Negative authority and compatibility (where applicable):** [Missing/revoked authority, unsupported mode, conflict and baseline preservation.] +**Matched native alternative:** [Same actor/task/inputs; no measured benefits.] + +| Proposed native test | Source-backed setup | Expected effect/return | Falsifier | +| --- | --- | --- | --- | +| [NOT_RUN test] | [Pinned source] | [Observation] | [Specific failure] | + +## 6. Proposal verdict, falsification, evidence ownership and handoff + +**Proposal-stage decision:** [Exact GO / NO_GO / BLOCKED from receipt.] +**Research disposition:** [Exact DECISION_READY / NEEDS_EVIDENCE / NO_USEFUL_CHANGE from receipt.] +**Primary falsifier:** [Specific disproof of target sufficiency.] +**Validation state:** [Exact receipt field; no test success claim.] +**Ownership of truth:** Profile owns semantics, Skills classification, Index accepted grades, original maintainer product decisions; receipt owns local draft decisions. +**Cost status:** NOT_MEASURED. +**Next permitted action:** [Local plan-only review; no canonical persistence, publication, code or grants.] +**Human backlink:** [issue.md](issue.md) +**case receipt:** [roadmap.md](roadmap.md) +**AI disclosure:** AI-assisted draft; no native tests or independent review presumed. diff --git a/templates/EXPERIMENTAL_ROADMAP_HUMAN.md b/templates/EXPERIMENTAL_ROADMAP_HUMAN.md new file mode 100644 index 0000000..544cbff --- /dev/null +++ b/templates/EXPERIMENTAL_ROADMAP_HUMAN.md @@ -0,0 +1,89 @@ +# [HARNESS] — experimental P/A Capability Roadmap + +**PLAN_ONLY · EXPERIMENTAL — DRAFT ONLY · DRAFT — NOT PUBLISHED** + +**One-sentence proposal:** [Source-grounded proposed function and selected ownership mode.] +**Canonical decision receipt:** [roadmap.md](roadmap.md) — local experiment only, sole decision source. +**Technical companion:** [constructor-sufficiency.md](constructor-sufficiency.md) +**Working fork:** [Verified matching fork, if present; otherwise NOT_PROVISIONED. No provisioning in this experiment.] +**Case:** [Local draft identifier; NOT_PERSISTED.] + +## 1. Why Opensiro and central accepted VSM assessment + +The VSM-informed construction and cost hypotheses are unproven; adoption belongs to the original maintainers. + +**ACCEPTED HISTORICAL INDEX** — [Exact pinned six-function vector, assessment blob, Index commit, review_ref, reviewed_at and versions.] +**Repository-wide audit:** [Current original HEAD, scope, source map and supported modes.] + +| Function / plain-language role | Historical Index state | Current owner / closure and evidence | Disposition and priority | +| --- | --- | --- | --- | +| **S1 · Operations** | [accepted] | [source] | [rank] | +| **S2 · Coordination** | [accepted] | [source] | [rank] | +| **S3 · Current management** | [accepted] | [source] | [rank] | +| **S3* · Complementary audit** | [accepted] | [source] | [rank] | +| **S4 · Future adaptation** | [accepted] | [source] | [rank] | +| **S5 · Identity and policy** | [accepted] | [source] | [rank] | + +A/C/P are ownership categories, not quality ranks. A(P)/C(P) are independently supported modes; P notation only applies to S3/S4/S5. — is bounded absence; ? is unresolved evidence. +**Priority rationale:** [Six-function comparison; qualified target family, no maturity ordering.] +**Deliberate exclusions / methodology challenge:** [Source-backed or UNKNOWN.] + +## 2. Selected construction hypothesis and operator outcome + +**Target family:** [A or P from receipt.] +**Target transition:** [Exact receipt transition or NO_QUALIFIED__TARGET.] +**Current selected function state:** [Exact receipt field.] +**Mode preservation:** [Exact receipt field.] +**Prospective authority:** [Exact receipt field.] +**Cross-function authority compatibility:** [Exact receipt field.] +**Function-specific disturbance:** [Observed or HYPOTHETICAL scenario.] +**Proposed target capability (P0):** [Complete A first-party autonomous mode or P parent-governed mode; no invented authority.] +**Best native operator alternative:** [Pinned existing alternative for same task.] +**Expected user benefit:** [Hypothetical or sourced evidence.] +**Architectural sufficiency argument:** [Complete source-native target path, mode ownership, required authority, effect and feedback; include mode rationale.] + +## 3. Existing native work versus missing construction + +**Track A — native coverage:** [Pinned shipped behavior, Issues and PR heads/overlap.] +**Track B — independent on-top target construction:** [Minimum missing native links; reuse where possible.] + +| Required target link | Existing coverage | Missing native integration | +| --- | --- | --- | +| [Decision owner, information and authority] | [Pinned sources] | [Delta or NONE] | +| [Effect and feedback] | [Pinned sources] | [Delta or NONE] | + +**Distinctness and falsifier:** [Equivalent target-mode evidence or other counterexample.] + +## 4. Priorities and minimum sufficient result + +- **P0:** [Exact selected target.] +- **P1:** [Necessary dependencies.] +- **P2:** [Optional separately justified work or NONE.] + +**Proposed target-sufficiency verdict:** [PROPOSED_TARGET_SUFFICIENT / INCOMPLETE_CHAIN / ALREADY_SHIPPED / UNVERIFIED / NO_QUALIFIED_TARGET, reconciled with receipt.] + +## 5. Proposed acceptance and stop gates + +**Future positive test:** [Mode-specific choice, effect and feedback.] +**Future negative test:** [Absent/revoked owner, stale data, authority, mode compatibility as applicable.] +**Proposed falsifier:** [Specific disproof.] +**Validation state:** [NOT_RUN or PARTIAL_WITH_PINNED_EVIDENCE from receipt.] + +## 6. Independent paths + +**Original-native contribution:** [Reuse existing work; unapproved local outreach draft only.] +**Profile / Skills:** [Separate evidenced question or NONE.] +**Domain fork:** [Optional lawful alternative or NONE; no provisioning.] + +## 7. Cost hypothesis + +Matched task comparison of integration, use, review and maintenance. Cost status: NOT_MEASURED. + +## 8. Decision / handoff + +**Proposal-stage decision:** [Exact GO / NO_GO / BLOCKED from receipt.] +**Research disposition:** [Exact DECISION_READY / NEEDS_EVIDENCE / NO_USEFUL_CHANGE from receipt.] +**Decision reason / next permitted step:** [Source-based; no production promotion without review.] +**Agent/developer handoff:** [constructor-sufficiency.md](constructor-sufficiency.md) and [roadmap.md](roadmap.md). +**Rights and publication:** [Actual license, formalities, owner control and prospective rights; EXPERIMENTAL_DRAFT_ONLY / NOT_PERSISTED / NOT_READY_FOR_EXTERNAL_PROPOSAL.] +**AI disclosure:** Prepared with AI assistance; no presumed implementation, tests, independent review or publication. diff --git a/tests/test_experimental_roadmap_targets.py b/tests/test_experimental_roadmap_targets.py new file mode 100644 index 0000000..d871e1a --- /dev/null +++ b/tests/test_experimental_roadmap_targets.py @@ -0,0 +1,145 @@ +"""Synthetic experimental A/P cases; no real source, authority or publication claim.""" +from pathlib import Path +import re +import sys +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "scripts")) +from validate_capability_roadmap import validate, validate_case_dir +from validate_roadmap_publication import check_case_structure, check_publication_ready +from test_roadmap_case_consistency import PROPOSAL, VECTOR + +BASE_FIELDS = { + "Current selected function state": "—", + "Mode preservation": "PRESERVE", + "Mode rationale": "Preserve supported modes; synthetic evidence", + "Prospective authority": "Synthetic bounded authority hypothesis only", + "Cross-function authority compatibility": "Synthetic scope and return; no new authority", +} + + +def receipt(target="A", current="—", after=None, decision="GO", preservation="PRESERVE", + fn="S4", historical="—", no_target=False): + after = target if after is None else after + fields = dict(BASE_FIELDS, **{ + "Target family": target, + "Current selected function state": current, + "Mode preservation": preservation, + "Target transition": f"NO_QUALIFIED_{target}_TARGET" if no_target else + f"{fn}={historical} -> {fn}={after}", + "Proposal-stage decision": decision, + "Research disposition": "NEEDS_EVIDENCE", + }) + vector = dict(part.split("=", 1) for part in VECTOR.split(" · ")) + vector[fn] = historical + vector_text = " · ".join(f"{key}={state}" for key, state in vector.items()) + body = (PROPOSAL.replace("proposal-gate", "experimental-proposal-gate", 1) + .replace(VECTOR, vector_text) + .replace("Proposed C construction", "Proposed target construction") + .replace("C sufficiency falsifier", "Target sufficiency falsifier")) + for key, val in fields.items(): + pattern = r"(?m)^- " + re.escape(key) + r":.*$" + if re.search(pattern, body): + body = re.sub(pattern, lambda _: f"- {key}: {val}", body) + else: + body = body.replace("## Function ownership", f"- {key}: {val}\n\n## Function ownership", 1) + return body, fields, vector, vector_text + + +def make_case(directory, target="A", **kwargs): + body, fields, vector, vector_text = receipt(target, **kwargs) + (directory / "roadmap.md").write_text(body, encoding="utf-8") + (directory / "README.md").write_text("# Case\nEXPERIMENTAL — DRAFT ONLY\n" + "[roadmap.md](roadmap.md) [issue.md](issue.md) " + "[constructor-sufficiency.md](constructor-sufficiency.md)\n", encoding="utf-8") + for filename, template in (("issue.md", "EXPERIMENTAL_ROADMAP_HUMAN.md"), + ("constructor-sufficiency.md", "EXPERIMENTAL_ROADMAP_AI.md")): + text = (ROOT / "templates" / template).read_text(encoding="utf-8") + text = text.replace("[HARNESS]", "Synthetic harness").replace("[selected function]", "S4") + if filename == "issue.md": + for fn, state in vector.items(): + text = re.sub(r"(?m)^(\| \*\*" + re.escape(fn) + r" ·[^|]+\|) \[accepted\]", + lambda m: m[1] + " " + state, text) + text = re.sub(r"(?m)^\*\*ACCEPTED HISTORICAL INDEX\*\*.*$", + "**ACCEPTED HISTORICAL INDEX** — " + vector_text, text) + for key, val in fields.items(): + text = re.sub(r"(?m)^\*\*" + re.escape(key) + r":\*\*.*$", + lambda _: f"**{key}:** {val}", text) + text = re.sub(r"\[([^\]\n]+)\](?!\()", "synthetic source-grounded draft", text) + (directory / filename).write_text(text, encoding="utf-8") + + +class ExperimentalRoadmapTests(unittest.TestCase): + def test_explicit_a_p_and_composite(self): + for target, current, after in ( + ("A", "—", "A"), ("A", "C", "A"), ("A", "P", "A(P)"), + ("A", "C(P)", "A(P)"), ("P", "—", "P"), + ("P", "C", "C(P)"), ("P", "A", "A(P)"), + ): + with self.subTest(target=target, current=current, after=after): + body, *_ = receipt(target, current, after) + self.assertEqual(validate(body, experimental_target=target), []) + self.assertTrue(validate(body)) # never accepted by default C gate + + def test_default_c_unchanged(self): + self.assertEqual(validate(PROPOSAL), []) + self.assertTrue(validate(PROPOSAL, experimental_target="A")) + + def test_parent_notation_function_boundary(self): + for fn, historical in (("S1", "A"), ("S2", "A"), ("S3*", "A")): + body, *_ = receipt("P", "A", "A(P)", fn=fn, historical=historical) + self.assertTrue(any("only for" in e for e in validate(body, experimental_target="P"))) + + def test_preserve_parent_and_autonomous_modes(self): + for target, current, after in (("A", "P", "A"), ("P", "C", "P"), ("P", "A", "P")): + body, *_ = receipt(target, current, after) + self.assertTrue(any("preserved current modes" in e for e in validate(body, experimental_target=target))) + + def test_explicit_hypothetical_replacement(self): + body, *_ = receipt("A", "P", "A", preservation="REPLACE") + self.assertEqual(validate(body, experimental_target="A"), []) + self.assertTrue(validate(body.replace("- Mode rationale: Preserve supported modes; synthetic evidence\n", ""), + experimental_target="A")) + + def test_no_go_and_blocked(self): + body, *_ = receipt("P", current="NONE", preservation="NOT_APPLICABLE", decision="NO_GO", no_target=True) + self.assertEqual(validate(body, experimental_target="P"), []) + body, *_ = receipt("A", current="?", preservation="UNRESOLVED", decision="BLOCKED") + self.assertEqual(validate(body, experimental_target="A"), []) + self.assertTrue(validate(body.replace("decision: BLOCKED", "decision: GO"), experimental_target="A")) + body, *_ = receipt("A", current="A", after="A") + self.assertTrue(any("already established" in e for e in validate(body, experimental_target="A"))) + + def test_wrong_family_and_historical_mismatch(self): + body, *_ = receipt("A") + self.assertTrue(validate(body, experimental_target="P")) + self.assertTrue(validate(body.replace("S4=— -> S4=A", "S4=C -> S4=A"), experimental_target="A")) + + def test_full_four_file_draft_and_production_gate_rejects(self): + for target in ("A", "P"): + with self.subTest(target=target), tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) + make_case(path, target) + self.assertEqual(validate_case_dir(path, experimental_target=target), []) + self.assertEqual(check_case_structure(path, experimental_target=target), []) + self.assertTrue(check_publication_ready(path)) + self.assertTrue(check_case_structure(path, experimental_target="P" if target == "A" else "A")) + ai = path / "constructor-sufficiency.md" + ai.write_text(ai.read_text().replace("**Mode preservation:** PRESERVE", "**Mode preservation:** REPLACE")) + self.assertTrue(any("Mode preservation disagrees" in e for e in check_case_structure(path, experimental_target=target))) + + def test_missing_marker_or_files(self): + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) + make_case(path) + readme = path / "README.md" + readme.write_text(readme.read_text().replace("EXPERIMENTAL — DRAFT ONLY", "DRAFT")) + self.assertTrue(any("missing experimental draft-only marker" in e for e in check_case_structure(path, experimental_target="A"))) + readme.unlink() + self.assertTrue(check_case_structure(path, experimental_target="A")) + + +if __name__ == "__main__": + unittest.main()