--- name: mc-cre-wave-v17 description: "Create and rule a Wave Plan in a CANONQ-NATIVE v1.7 Mission (the Definition's The Wave Plan; DECISION-WAVE-PLAN-MC17-001). Reads the approved unlanded IPs, their Cross-IP Assumptions and the ARCH's Ordering Constraints (mc17 wavecheck), drafts the Wave Settings (mc17 wave draft) and proposes membership and an edge-consistent order, all marked as offered. Creates, checks and verifies the plan, then takes the rulings over the published version: the Technical Owner's choices, and for two or more plans the Business Owner's grouping and the Technical Owner's order, in one ruling ledger record the plan's status line names. Supersedes the prior plan in the series. Triggers on \"create wave v17\", \"mc-cre-wave-v17\", \"plan a wave\". Optional argument = wavenum (default: next in the series)." --- # mc-cre-wave-v17 Read this file to the end before acting. This skill's whole product is the rulings the wave's size owes and the record that carries them: it analyzes and proposes, marks every proposal as offered, and rules nothing itself. `mc17` is the launcher `client/mc17` two levels above this skill's folder, from a POSIX shell, Git Bash included, and `client/mc17.cmd` from PowerShell or cmd. Every record this skill appends carries `recordedBy`, the name of the person or session that writes it down, on a ledger of either version. ## Parameters - **?** - display the block below and stop. - **wavenum** (optional) - the sequence number. Where it is absent, take it from `mc17 nextnum WAVE-PLAN --scope {SCOPE} --collection --repo {repo}`, which reads the repository and the corpus together. On exit 0 the sequence part of its answer is `{seq}` from here on. On exit 1 the verb has refused, because the highest figure it found is a mention in a document's body that no filename and no document title holds, which is either a forward name announcing this very plan or a reference left behind by a deleted one. It prints both candidates and the mention's file and line. Read that line and put both candidates to the author. Where no author is reachable, take candidate 1 where the line plainly announces this plan, and otherwise stop and name the block. `--accept-mention` takes the HIGHER figure and prints the acceptance on the answer (IP-MC17-022). ``` mc-cre-wave-v17 v0.1.0 (MC 1.7 - CanonQ-native) Parameters: ? | wavenum (default: next in series) Mechanical half: mc17 (version, wave draft, create, amend, wavecheck, fields, hash, rulings, orphans, wave lock). The force of the artifact: one ruling record in VF-{SCOPE}-001, named in the plan's status line. ``` ## Step 0 - Which copy, which Mission, which line `mc17 version`, exact-title resolution of `MANIFEST-{SCOPE}-001`, limit 50, pin gate: v1.7 proceeds, v1.6 has no wave-plan law and stops with that sentence, no readable pin stops. A Mission with no VF ledger stops: the ruling record needs somewhere to land, and the chain starts at `mc-vf-manifest-v17`. ## Step 1 - The evidence Read, and hold as evidence with the command outputs kept verbatim: - **The candidates:** every IP row in the Manifest's tracked table, each with its asset id, and each IP's approval state from the ledger (`/records/*[/refs/0/doc=IP-{SCOPE}-{n}]`, the last approval record). Landed IPs, named as landed in their row's Status cell, are out: a wave plans what has yet to land. **A plan whose state word reads `Rework` is in**, and its row in the plan carries the record that ordered the rework (Definition Section 5, *A plan in Rework is re-executed as a member of the next Wave Plan in the series*); its re-execution publishes the plan's next Implementation Report, and the integration stage re-runs every suite the reworked increment touches, named in the plan. - **The edges:** the ARCH's asset id from the note beside the tracked table, and the members' bodies; `mc17 wavecheck` reads both once a draft plan exists, and at this step the same parsers run over the candidates through the proposal below. - **The base:** a claim about where the wave starts, or that a base has not moved, is evidenced with `mc17 currency --repo {repo} --base {sha}`, which fetches the remote FIRST and exits nonzero on drift, because a local ref proves only what the clone last heard (Profile 8.15, IP-MC17-016). A `--branch` it cannot resolve is refused by name, state `no-branch`, and no other ref is read in its place (M-MC171-18). - **The series:** the highest existing `WAVE-PLAN-{SCOPE}-*` by exact-title search; its ruled membership is what a new plan supersedes. - **The standing rulings:** `mc17 rulings --ledger `, printed beside the proposal in Step 2, so the rulings this skill takes are given with the standing ones in view (Definition Section 1, *The Rulings register*). A Mission with no register is named as owing one; the rulings this act takes are written into the register in the same act, which is the Profile 1.5 obligation. - **The unowned cases:** `mc17 orphans --tp --ips `; each orphan the tool names is a case no member proves, and the proposal assigns it to the integration stage unless a member's author claims it. ## Step 2 - The proposal, marked as offered Draft the values with `mc17 wave draft --manifest --ledger --members --seq {seq} [--supersedes WAVE-PLAN-{SCOPE}-{prior seq}] [--mode fleet | hand] --out draft.json`. The command writes the answers the plan renders from: every Wave Settings row with its value in force and its source marked `offered: {source}`, the mode, the line `Integration run:` reading `none stated`, each member's `rounds` from the `wave.fix.rounds` row, and, in a fleet wave, the test-practice sentence in `rules`. Pass `--mode hand` where a person lands the wave; the mode row then reads `offered: override` with a placeholder reason that the Technical Owner's words replace. Put the draft before the Technical Owner with every value marked as offered, beside the rest of the proposal. Where the Mission's setting `wave.prompts` reads `template`, the draft also carries the row `wave.prompts`, and the prompts of every agent of the wave are rendered in Step 4 item 1, after the answers of Step 3, so that a setting, a mode or a member an answer changes reaches the prompts. Compose a candidate membership (the approved, unlanded IPs) and an order consistent with every declared edge, strictest checks first and the repository-describing IP last where the edges leave the choice open. The proposal also names the **integration stage**: the wave's final stage, a verification at the tip that will merge, running every suite the members shipped back to back on one instance in the ruled order, plus the orphan cases Step 1 found. It is never the last member's landing (Definition Section 5; L3/F4, VF-KDOM-001 records 36 and 37). **Every element of this is an offer.** Where the edges admit no order, say so with the contradicting edges named, because that is a finding about the IPs, and stop short of proposing an order that violates a declared edge. ## Step 3 - The questions the wave's size owes Ask each question separately over the proposal, and record the words verbatim. The answers become the plan's override reasons and the reasons in its two ruling sections; the rulings themselves are taken in Step 4, over the published version. 1. **The wave's choices, the Technical Owner's, in every wave:** the Wave Settings values, the mode and the command of the integration run, read from the draft. His words are recorded under `Choices (TO):`. Where he asks for a value other than the one offered, the plan carries that value with the source `override` and his reason. 2. **Where the wave holds one plan, ask no grouping question and no order question.** A wave of one plan has nothing to group or order: `mc17 wave draft` writes `one_plan` true, and the plan's two ruling sections carry the template's fixed sentence. 3. **Where the wave holds two or more plans, the grouping, the Business Owner's:** which IPs ship together, and which wave ships first. Offer the candidate set; he may cut or add for programme reasons, a client priority, a commitment, a date, and the reason is recorded in his words. **An unapproved IP may be named**, and the plan then says on its face that the wave cannot open until every member is approved, which is the plan's lean the BO adopted. 4. **Where the wave holds two or more plans, the landing order, the Technical Owner's:** offer the edge-consistent order. An override that violates a declared edge is refused here with the edge named: the repair is a ruling on the ARCH or the IP that declares the edge, never a plan that silently contradicts it. 5. **The grouping reason and the order reason**, where the wave holds two or more plans: one short passage each, in the authority's own words, into the plan's two ruling sections. ## Step 4 - Create, check, note, verify, rule, mark Run the items in this order. Nothing is ruled before the plan stands in the corpus, checked and verified, because a ruling taken over a draft file binds a text with no version and no binding. 1. **Create**, from the draft, after three changes the skill makes first: it removes `offered: ` from every cell; it puts the authority's words in place of each placeholder reason, such as the mode's `offered: the Technical Owner's reason`; and it keeps the draft's test sentence at the head of `rules`, with the wave's rules prompt after it. A value the Technical Owner changed in Step 3 goes in with the source `override` and his reason. Then add the answers the draft leaves to the skill: `summary`, `integration_cases`, the command of the integration run in place of `none stated`, `grouping_reason` and `order_reason` where the wave holds two or more plans, and, in a fleet wave, the prompts of each member, `build`, `lens_names`, `lenses`, `bars`, which holds one line per lens, `{lens name}: {what this lens blocks on}`, `fix` and `land`, beside the `rounds` the draft wrote. Where the draft's row `wave.prompts` reads `template`, the skill writes none of those prompts by hand: after the three changes and the answers above, run `mc17 wave prompts --draft draft.json --manifest --ledger --members --repo {repo} --base --branch --work --clones --release --attribution "" [--connector ] --out draft.json`, which adds the rules and, in either mode, every prompt of each member, rendered from the engine's stage-prompt template over each member's verified text, the draft's settings, the ledger and the figures of the base, with the line `Rendered:` that names those inputs. Every word of those prompts is the template's, and a change the Technical Owner asks of a prompt is a change of the template, which a plan makes. A member whose rounds differ from the plan's `wave.fix.rounds` row carries its reason after the number, as in `2, the plan touches one file`. **The prompts and the settings are text the ruling covers**, so a prompt or a value changed after the ruling is a new wave plan at the next sequence number, the way a member added or pulled is. `mc17 wave script --plan {plan_asset_id} --out {script}` writes the fleet script's authored half from the prompts and stamps the digest of the prompt set on its first lines, and the launch door refuses a script whose prompts have moved from that stamp. Render with `mc17 render wave-plan` to a file, run the skill `mc-plain-v17` over that file, and create with `mc17 create --file --plain --manifest {manifest_asset_id} --ledger {ledger_asset_id} --type WAVE-PLAN --authority A2 --lifecycle draft` with the Mission's tags and domains. `mc17 create` refuses a governed title without proof of the plain-language pass (`AC-24`). `integration_cases` lists the Test Plan cases the integration stage owns, by identifier; `mc17 orphans --wave` reads them from the plan's *Integration stage* section. The identifiers before that line's first sentence ends are what `mc17 stage --wave ` runs at the merging tip, and nothing else: prose after the first sentence may name a case and assigns none, and a case the Test Plan assigns to a plan or marks post-landing is refused there by name (IP-MC171-011). 2. **Check:** `mc17 wavecheck {plan_asset_id} --arch {arch_asset_id} --map map.json --manifest {manifest_asset_id} --ledger {ledger_asset_id}`, the map from every IP row of the tracked table. It prints each setting in force and fails a Wave Settings row with no value, a value outside the allowed values, an override with no reason, the word `offered` in any cell, a missing row, and an `Integration run:` line that is missing, holds no command in backticks or reads `none stated`. It reads the prompts besides: every member of the table has a block, every block names a member, and every prompt reads clean against the writing rules, which the document lint leaves unread inside a fence; a hand plan carries no prompt block. Where the plan's row `wave.prompts` reads `template`, a hand plan carries its prompts as a fleet plan does, an unruled hand plan that carries the line `Run by hand: this wave carries no fleet prompts` fails, and `mc17 wave prompts --check --plan {plan_asset_id} --manifest {manifest_asset_id} --ledger {ledger_asset_id} --members --repo {repo}` renders the prompts again from the inputs the plan's line `Rendered:` names and names each prompt that moved. It refuses a plan that rules the review off where the Manifest declares collapsed authorities, and a fleet plan that rules the review off or sets fewer than two lenses. It prints the state of each plan an edge waits on outside the wave. A problem here stops the run before the ruling: nothing is ruled over an inconsistent plan. Lines the check names as **unread** stand outside a bullet in the ARCH's Ordering Constraints and bind nothing; each goes beside the proposal, so the authorities see what the ARCH says that orders no wave (M-MC171-19). 3. **The note** beside the Manifest's tracked table, its slot reading `Unruled`: one guarded live-state amend writing `**Ledger-tracked beside this table:** WAVE-PLAN-{SCOPE}-{seq} - asset {id} - AO {ao_string} - Unruled - {date}`, whose label tells `mc17 check --documents` that the ledger tracks the plan. The note comes before the verification because the verifier compares the plan's AO line with the AO its note carries. 4. **Verify:** run `mc-vf-wave-v17` over the unruled plan. Its PASS record says that the plan binds nothing yet and names the version it read, and its stamp carries the line `**Binding:** sha256:{hex} (projection mc-v17-artifact-text-projection/1)`. A FAIL stops the run before the ruling. Then run `mc17 published {plan_asset_id} --ledger {ledger_asset_id}`: it fetches the plan by its asset id and proves that the version on the page is the version the verification passed, the plan's binding, its stamp line and the record's `Verified:` line agreeing. A refusal stops the run before the ruling, naming the verifier run owed. 5. **The rulings**, taken over the published version by its asset id and version number: the Technical Owner's words on the wave's choices in every wave, and the grouping and the order where the wave holds two or more plans, as Step 3 asked them. Where an authority asks for a different value, write the next version with the change and run items 2 and 4 over it again before taking his ruling. Where the plan's row `wave.prompts` reads `template`, render the next version's prompts again first, with the command of item 1. Where an authority refuses the ruling, stop here: write no ruling record, no flip, no lock change and no mark, so the prior plan keeps its force and its lock, and the new plan binds nothing. Where the session has announced no speaker for the words, ask who speaks them, in which role and under which name, before the record is written. The record carries `spokenBy`, one entry `{role} {name}` for each passage of `authorityWords`, in the order the passages stand. 6. **The ruling record**, appended with `mc17 append {ledger_asset_id} --record `, the record written to a file first: kind `ruling`, `refs` leading with the plan, then every member IP, then the ARCH; `authorityWords` carrying `Choices (TO): {words}` in every wave, and `Grouping (BO): {words}` and `Order (TO): {words}` where the wave holds two or more plans, verbatim; evidence carrying the wavecheck output and the `published` output; the body carrying the line `Read: {asset id} version {n}, binding {hex}, verified at record {m}` that `mc17 published` printed in item 4. Read `n` back. 7. **The register rows:** append each ruling to `RULINGS-{SCOPE}-001` by guarded amend (`--class artifact --expect-binding any`, the register is live state; where the rows move the register's binding, the amend names the authority with `--written-by` and the Manifest with `--manifest {manifest_asset_id}`, since each row carries that person's own words and the command passes only a name the Manifest's Authorities section lists), each ruling a `### R{n}` section placed at the end of `## Rulings`, before `## Change Log`, because `mc17 rulings` reads no ruling outside that section, each row's words verbatim in a fence, Given `TO, {date}` for the choices and the order and `BO, {date}` for the grouping, Implemented in `WAVE-PLAN-{SCOPE}-{seq} - asset {id}`, Verified by `VF-{SCOPE}-001 record {n}`. Where the register holds no row yet, or `mc17 amend` refuses a row and names the register's scaffold record, its first rows go in by `mc17 amend --jargon --plain --manifest {manifest_asset_id} --ledger {ledger_asset_id}`, the skill `mc-plain-v17` run over the whole register as those rows leave it; the later rows go in by `--written-by`, as this item says. A Mission with no register gets one now: `mc17 create --render rulings --answers --scaffold --ledger {ledger_asset_id} --type RULINGS --authority A2 --lifecycle current`, with the Mission's tags and domains, its row noted beside the tracked table, because a ruling heard and written nowhere is the edge IP-MC17-004 exists to close. 8. **The flip, live state only:** one guarded amend, `--expect-binding unmoved`, setting the status line to `**Status:** Ruled: VF-{SCOPE}-001 record {n}, {date}. Immutable from that record on; a change is the next plan in the series.` Where members await approval, the line carries `The wave opens when every member is approved.` In the same act the note's slot changes from `Unruled` to `Ruled: record {n}`. The binding the record cites is the binding the plan keeps, which is the whole design: the status line stands outside the binding, so the flip moves nothing the verification read. 9. **The branch lock** (IP-MC17-003 Part 1; Profile 8.1, wave work reaches the branch only through the runner). Once per repository, `mc17 wave hooks --repo ` installs `.mc17/hooks/pre-commit` and sets `core.hooksPath`; commit the hooks directory and record the act in the repo's setup note. Then, on the Mission's branch, `mc17 wave lock --plan {plan_asset_id} --name WAVE-PLAN-{SCOPE}-{seq} --record {n} --repo --manifest {manifest_asset_id} --ledger {ledger_asset_id} --arch {arch_asset_id} --map map.json` writes and commits `.mc17/wave.json`; the engine keeps the wave token and prints none (D34); for a plan run by hand whose row `wave.prompts` reads `template` the lock also carries `handPrompts`, the digest of each start text the plan rules, which the heavy-run hook reads at each agent start; the lock line passes the four inputs `mc17 wavecheck` took in item 2. `mc17 wave script` writes the token into the wave script's stage specs as `waveToken`, where `runStage` hands it to its build and fix agents; it is stored nowhere else. From this commit on, a commit on the branch outside a stage call is refused by the hook, and a deliberate override (`MC17_WAVE_OVERRIDE=`) is journaled and named by the closure history check. When the wave's integration stage has passed and the branch has reached the trunk, `mc17 wave unlock --repo ` removes the lock in a commit of its own, the engine supplying the token. The unlock also removes from the store's `hand.json` every entry of the wave, whatever checkout the lock was taken in, and prints a `Registry :` line for each; a line that opens `Clone` names each other checkout of the wave that still holds the lock file, and the session removes that clone, because the heavy-run hook judges every folder under it as part of the wave while the file stands. A superseding plan in the series unlocks the old wave and locks the new one. 10. **The supersession mark**, where a prior plan exists: one guarded amend on the prior plan's status line, `--expect-binding unmoved`, prefixing `Superseded by WAVE-PLAN-{SCOPE}-{seq}, {date}.` Its note beside the Manifest's tracked table is updated in the same act; each plan note reads `WAVE-PLAN-{SCOPE}-{seq} - asset {id} - AO {ao_string} - {Unruled | Ruled: record {n} | Superseded by {next}} - {date}`, and the AO rides in it because `mc-vf-wave-v17` compares the plan's own AO line against it. **The verification owed.** Where `mc17 amend` printed `VERIFICATION OWED NOW: {skill}` as its last line, run that skill over the document before this skill reports: the note, the flip and the supersession mark are live-state writes and owe none; the register rows of item 7 owe what their amend prints; a line `NO VERIFIER: {class}` owes nothing. ## Step 5 - Report Ids, hashes and the record number as printed; the membership with each member's approval state; the edges honoured; every ruling quoted; what opens the wave where members await approval. ## Rules this skill cannot check - Whether the grouping is right: the BO's, and programme grounds are lawful grounds. - Whether the order is wise beyond the declared edges: the TO's. - Whether an edge nobody declared exists in the code: the IP authors'; an undeclared edge is invisible here and surfaces at execution.