--- name: mc-close-mission-v17 description: "Perform the Business Owner's closure act for a CANONQ-NATIVE v1.7 Mission. Gate: a Move Acceptance record (mc-vf-move-v17) at PASS and current. Verifies every Manifest closure condition against the records, conducts the closure interview (a delegate's words attributed to the delegate under DECISION-TRIAL-DELEGATION-MC17-001 on apparatus trials), appends the closure record with authorityWords and the frozen content hash of every governed artifact, and flips the Manifest's status line to Closed by one guarded live-state amend. A closed Mission is immutable; its PLs live on under their AOs. Triggers on \"close mission v17\", \"mc-close-mission-v17\". No positional argument." --- # mc-close-mission-v17 Read this file to the end before acting. Closure is one authority's act carried on records, and this skill refuses to substitute for either: no record, no closure; no words, no closure. `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. ``` mc-close-mission-v17 v0.1.0 (MC 1.7 - CanonQ-native) Parameters: ? (the Mission resolves from context or is named) Mechanical half: mc17 (version, hash, binding, check, amend, ledger, rulings, evidence) plus ledger reads and one patch. Gate: the Move Acceptance record at PASS, at bindings that still hold. ``` ## Step 0 - Which copy, which Mission, which line `mc17 version`, exact-title resolution, pin gate as everywhere. Read the census whole: closure freezes everything, so everything is read. ## Step 1 - The gate The ledger's last Move Acceptance record (the `mc-vf-move-v17` verification leading with the Manifest) stands at PASS, and the Manifest's binding now equals the binding that record read. A missing, failed or stale acceptance refuses closure naming `mc-vf-move-v17` as the way back. Every numbered closure condition is then re-read against the records, and an unsatisfied condition refuses closure naming it; conditions 3 and 4 are conditional rules: binding where a measurement was commissioned, and resolved by the Business Owner's recorded statement where none was. The statement lives in the closure record (Step 2), and the conditions' own text is read against it. ## Step 2 - The closure interview 1. **The measurement question**, where conditions 3 and 4 name a measurement nobody has commissioned: does the Business Owner commission one? `Yes` refuses closure until the freeze and the test have run as those conditions demand. `No` is a statement, and the statement lands in the closure record's body, NEVER in the conditions. The conditions' conditional text resolves against the recorded statement, and the closure record is where an auditor finds it. Writing `not applicable` into the conditions is a declarative edit: it moves the binding, stales every approval bound to it, and breaks the very guard Step 4 closes with. Seventeen-16's closure met this contradiction live (its closure log, D-C6) and resolved it record-side; that resolution is the rule this step states. 2. **The closure decision, in the authority's own words**, verbatim, into `authorityWords`. On an apparatus trial the delegate's words are attributed to the delegate under the standing delegation. 3. **The speaker.** 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. A delegate's words name the delegate, as item 2 attributes them. ## Step 3 - The freeze and the record **The persons the Manifest names, before the record.** Before the closure record is written, run `mc17 settings --owed --manifest {manifest_asset_id}`: the closure record's body carries every line it prints, as it prints them, under its own heading, the line `## Settings reviews`, beside the sentence that this act runs the review of the settings of the person whose session closes the Mission in Step 6, after the record. The command runs with the Mission's credentials, as the other commands of this step do, and prints one line for each person the Manifest's Authorities name: the line of the person whose session runs this act reads `Settings review: {name} ({roles}), run by this act in Step 6 with mc-adv-settings-v17 review`, and every other line reads `Settings review: {name} ({roles}), in that person's own session: mc-adv-settings-v17 review, ordered by this closure record`. It reads no document of any settings collection. Where it prints no such line, the heading carries what it printed, and the closure goes on, since no step of this act waits on a settings review. Hash every governed artifact of the collection with `mc17 hash {assetId}` and hold the figures: these are the frozen hashes immutability enforcement reads. Run `mc17 ledger {ledger_asset_id}` and take its list of standing defect records: **every one goes onto the closure record's face with its disposition** (Definition Section 10, *The defect record*, and Section 13; L1/F5, VF-KDOM-001 record 42). A standing defect whose disposition is `repair here` refuses closure naming it, because the repair was promised inside this Mission; `repair in {Mission}` and `accept` close with the defect named. The closure act refuses to write a record that omits a standing defect. Run `mc17 rulings {register_asset_id} --ledger {ledger_asset_id}` once more: an incomplete row refuses closure naming it, which the Move sweep already said, and **a deferred act past its date refuses closure naming the act, the date and the authority** (Profile 5.2), and a deferred line the verb reads `UNREAD` refuses closure naming its line, because an act written there is counted nowhere: the debt a repair ruling named is paid before the Mission closes, or its date is moved by the same authority in a new row. Run `mc17 accept --spec {spec_asset_id} --tp {tp_asset_id} --results {run_manifest} --manifest {manifest_asset_id} --ledger {ledger_asset_id}`: **a criterion whose covering tests have not all run green refuses closure naming it** (Definition Section 10, *The proven criterion*; IP-MC17-017), unless the Move Acceptance record already carries its owner's ruling on the narrowing, in the owner's words, with every deviation entry that names the criterion surfaced; a criterion that shipped narrowed with no owner ruling is the hollow criterion, and it does not pass into a closed Mission in silence. A criterion that `mc17 accept` prints `ok` as `accepted with resolved defect {n}` refuses nothing, and the closure record names each such criterion with its case, its defect record and the record that resolved it, under its own heading `Accepted with resolved defects`. **A ruled reading whose row the reconciliation check does not read as reconciled refuses closure naming the row** (Profile rule 1.9): the same call reads each row of a reading in the Manifest against the ledger, and a row that reads `reconciled: pending`, or whose reconciliation fails a test, is named with what it lacks. Run `mc17 landing --repo {repo} --range {base}..{tip} --ips {docs_or_ip_set} --manifest {manifest_asset_id}`: **an unplanned landing, the merge of a plan of record no ruled Wave Plan names, or an undeclared repair on the trunk refuses closure naming it, and so does a range holding no commit, which the audit reads as nothing audited** (Profile, L14; IP-MC17-018), because a Mission that closes over work no ruled plan governs closes over a change nobody can trace to intent; **a release the audit lists, a commit that names no plan, fails nothing, and the closure record states each release in its own text**, with its sha, its parent count and its committer, because the audit cannot tell a release from an administrator's bypass and leaves that judgement to the Business Owner; the audit reads what reached the trunk whatever branch built it, and an administrative override that let one through leaves no fingerprint in git history, so the landing it let through is named where it reached the trunk and the override's prevention is the owner's over the repository's configuration. Run `mc17 unlanded --repo {repo} --range {base}..{tip} --ips {docs_or_ip_set} --ledger {ledger_asset_id}`: **a plan of record no landing names, net of reverts, refuses closure naming it** (R-LANDING); a plan whose Status opens with `Withdrawn`, `Superseded` or `Deferred` owes no landing, and the verb reads a landing as a commit naming the plan, never as what the commit changed; a plan whose accepted record lands it by an amendment record the ledger holds counts as landed. Run `mc17 check {manifest_asset_id} --ledger {ledger_asset_id} --documents`: **a landed plan that the acceptance join or the Wave Plan join prints as FAIL refuses closure naming the plan**, and so does every other row it prints as FAIL, the stale approval entry and the verification a document owes among them; a ledger the joins read as one that declared nothing of the acceptance rule passes them, and the closure record says so in the joins' words. Run `mc17 evidence {collection_id}`: **a failing evidence join refuses closure naming the debt** - the evidence asset no record cites, the dangling citation, the record declaring `producedBy: independent` while naming no `evidenceAsset`, the declaration outside `independent|recorder`, the declared repair that repairs nothing, or the open work-order item - because a Mission that closes over evidence a reader cannot reach closes over evidence nobody weighed, which is the reasoning this act already carries for an unrecorded review and an undispatched work order (Definition Section 10, *The review record* and the independent act beside it; IP-MC17-007, IP-MC17-011 L8). The debt is payable without touching what the ledger froze: a record already written is repaired by a LATER record whose text opens `RESOLVED {n}`, which declares `repairs: [n]` and carries the evidence asset itself, which is where the join then reads the citation. **Closing a Repair Move** is the `RESOLVED {n}` record against its defect, written after `mc17 ledger --repair` passes; where the parent is closed, the same record is appended to the parent's closed ledger naming the repair collection, and the repair collection's Manifest-side note takes `Resolved, record {n}`. Append one record with `mc17 append {ledger_asset_id} --record `, the record written to a file first: kind `closure`, verdict PASS, `refs` every artifact by name and asset id, `authorityWords` verbatim, evidence carrying the acceptance record's pointer, the `ledger` output and the hash commands with their outputs, the body stating what closed, at which figures, every standing defect with its disposition under its own heading `Standing defects`, and that a closed Mission's artifacts change under correction form, ruling records and defect records alone. Take the number the command prints. A stage record whose runs were made by `mc17 stage` at the tip it names is read as a sanctioned run. The sentence that no sanctioned stage made a wave's commits belongs to the stages before that verb, and `mc17 history` reads both kinds the same (IP-MC171-011). **A defect found after closure** is written with `mc17 append` as a `note` record opening `DEFECT` into this ledger, the one append a closed Mission's ledger still admits beside correction and ruling records; it names the artifact, the authority's words, and a disposition from the vocabulary `repair here | repair in {Mission} | accept` (after closure the first form no longer applies: the Mission repairs nothing anymore, so `repair in {Mission}` or `accept` are the two that stand). The closed Mission stays closed, and its ledger no longer reads clean. ## Step 4 - The status flip, the last write to the Mission One guarded amend on the Manifest, `--expect-binding unmoved`: the status line under the H1 becomes `**Status:** Closed, {date}. Closure: VF-{SCOPE}-001 record {n}. Every artifact frozen at the hashes that record carries.` and the tracked rows this closure settles take their final state words. Nothing declarative is touched, which the guard enforces; the binding the closure record cites is the binding the Manifest keeps forever. ## Step 5 - The Missions row After the status flip, run `mc17 settings --row close --manifest {manifest_asset_id} --record {n} --by mc-close-mission-v17`, where `{n}` is the number of the closure record Step 3 took. The command marks this Mission's row closed in the `MISSIONS` table of the person whose credentials the session holds, writes the ledger cell, and names the closure record in that table's Change Log, only where the host of the credentials is that person's settings instance. Where the Mission lives on another instance, the command writes no row and prints the hand form's command line, which the session gives the authority in the closure's report. Where the command refuses the write, the closure stands as written, and the report names the refusal; `mc17 settings --check` then names the row. ## Step 6 - The settings review Once Step 5 has written or named the Missions row, the act runs the review of the settings of the person whose session closes the Mission, ordered by the closure record, through the mode `review` of `mc-adv-settings-v17`, and gives that person the review's link. **The lines.** The session writes `{folder}/ordered.json` with the closure record, `VF-{SCOPE}-001 record {n}`, as `record`, and runs the two lines of that mode, each a POSIX shell line that loads the person's settings credentials inside its own parentheses, so every other command of this act keeps the Mission's credentials: - `mc17 settings --export {folder}` - `mc17 settings --review {folder}` **Where the permission mode stops a closure's settings line.** Where the session's permission mode refuses a line of `mc17 settings`, the session shows the person that one line and what it does, and runs it only once the person has run it or sent it back. The sign-in stays the person's own: the session never runs `mc17 login` or `mc17 trust`. **What the closure waits for.** The Mission closes whatever the review finds: the closure record and the status flip stand before this step, the review's findings go to the person's triage, and no step of this act reads them. **Where the heavy-run hook refuses the review's agents.** The mode's step on the hook applies, and the act records no settings act on the Mission's ledger. The report names that person's review as not run, with the command `mc-adv-settings-v17 review VF-{SCOPE}-001 record {n}` for the person to run from a session outside the checkout. **Another instance.** Where the settings credentials the line loads reach another host than the person's settings instance, the command refuses and names both hosts. The report then names the review as not run, with both hosts and the line the person runs in a session on the settings instance. **The report.** The closure report names each other person the Manifest names, with the command that person's own session runs, `mc-adv-settings-v17 review VF-{SCOPE}-001 record {n}`, the closure record by its number, taking those persons from the lines `--owed` printed as owed, and Step 5's outcome: the row written, the hand form's command line, or the refusal. **The closing person on a Mission of another instance.** There `--owed` marks no line as this act's, so the closing person's own line reads owed too. Where this step's review landed, the report leaves out the owed line whose name equals the name in the title of the collection `--export` read, after `MC Settings `, compared with letter case and runs of white space set aside, and says that Step 6 ran it. So the report of every closure names each other person and no one else. ## Rules this skill cannot check - Whether closing is right: the Business Owner's alone, and the interview is where he says it. - Whether a later edit violates the freeze: the ledger's correction form and whoever audits against the frozen hashes. - Whether each other person runs the review the report names for them: that stands with the person's own session, and with their own `mc17 settings --check`, which repeats the order.