## §SELF — miscsubjects capability (paste without context)
**Principle:** Self-explaining payload — no external context required. This _self block is the capability: what it is, how to run it, how to change it, and where to look next.
**Path:** OIP > CODE > CODE_LEASE_START
**Capability:** `CODE_LEASE_START` — Open a coding lease. You declare the files you are about to edit and the sha256 of each file's contents as you just read them. Returns a lease id and a start hash.
**When to use:** before your first edit of a session, always. A lease opened at commit time can only report a collision that already happened.
**RUN NOW (open this URL):** https://miscsubjects.com/api/dispatch?invoke=CODE_LEASE_START&body=claude%3A7d88e44e%7C%5B%7B%22path%22%3A%22functions%2Fa%2F%5Bslug%5D.js%22%2C%22base_sha%22%3A%229f2c%E2%80%A6%22%7D%5D%7Cadd%20the%20ledger%20thread%20to%20every%20article&share=<TOKEN>
**Example call:** [CODE_LEASE_START]claude:7d88e44e|[{"path":"functions/a/[slug].js","base_sha":"9f2c…"}]|add the ledger thread to every article[/CODE_LEASE_START]
- **type · runner:** tool · fn · infra
- **run it:** Open run_now (URL, fires the example), or POST https://miscsubjects.com/api/dispatch {"key":"CODE_LEASE_START","body":"claude:7d88e44e|[{"path":"functions/a/[slug].js","base_sha":"9f2c…"}]|add the ledger thread to every article"}. From the router: [CODE_LEASE_START]claude:7d88e44e|[{"path":"functions/a/[slug].js","base_sha":"9f2c…"}]|add the ledger thread to every article[/CODE_LEASE_START]
- **inputs:** {"args":"$1 = your agent name. $2 = a JSON array [{\"path\":\"functions/x.js\",\"base_sha\":\"<sha256 of what you read>\"},…]. $3 = one line saying what the work is."}
- **outputs:** { ok, result, invocation, yield, _self } — result is this object's output; yield is tokens/cost/material; invocation is the ledgered record.
- **auth · risk:** none · low
### What this token can do here (computed for: public)
Only moves this credential can take are listed. The server enforces scope regardless; an omitted move would be denied anyway.
- **contract** — GET https://miscsubjects.com/api/dispatch?key=CODE_LEASE_START&format=markdown → this object's full contract (public docs plane)
- **confirm** — GET https://miscsubjects.com/api/dispatch?confirm=INV_ID → public proof that an invocation happened — no credential needed
### Machine Contract
- Read this article first; do not infer the row shape from memory.
- If acting with a URL-only tool, open run_now after replacing placeholder args.
- If the call returns ran:false or proof.ok:false, read the receipt and repair the failed invocation instead of narrating success.
- If the token denies the call, report the denial exactly; do not switch to a broader action unless the owner supplied a broader token.
### Invocation, Ledger, Repair
- root tree: https://miscsubjects.com/api/dispatch?map=1&format=markdown
- parent system article: https://miscsubjects.com/api/dispatch?map=CODE&format=markdown
- append-only ledger: https://miscsubjects.com/api/invocations?object_id=CODE_LEASE_START
- receipt pattern: https://miscsubjects.com/api/dispatch?receipt=inv_ID&share=<TOKEN>
- replay: POST /api/dispatch {"replay":"inv_ID"}
- repair: POST /api/dispatch {"key":"CODE_LEASE_START","body":"corrected args","repairs":"inv_ID"}
### Troubleshooting
- **unknown key** — Use the did_you_mean links or ask URL; never guess another key. · https://miscsubjects.com/api/dispatch?ask=CODE_LEASE_START
- **argument/body mismatch** — Read inputs/example_args here, then retry with repairs: inv_ID so lineage closes. · https://miscsubjects.com/api/dispatch?key=CODE_LEASE_START
- **expired or corrupted token** — Report token_expired/token_corrupted from the response; owner mints a fresh scoped link. · https://miscsubjects.com/api/dispatch?explain=1&share=<TOKEN>
- **tool returned ok:false / exit nonzero** — Do not call it sent. Read the receipt, correct the body, fire a repair. · https://miscsubjects.com/api/dispatch?receipt=inv_ID&share=<TOKEN>
### Logical proof (verify each step)
1. Every capability is an invokable object with its own _self — this block. → https://miscsubjects.com/api/dispatch?key=CODE_LEASE_START
2. You run it by POSTing to /api/dispatch; in a model turn the router tag is [CODE_LEASE_START]args[/CODE_LEASE_START]. → https://miscsubjects.com/api/dispatch?registry=1
3. Every invocation is ledgered with actor, cost, and material/waste. → https://miscsubjects.com/api/invocations?object_id=CODE_LEASE_START
4. You can ask the build for capabilities in plain language. → https://miscsubjects.com/api/dispatch?ask=Open%20a%20coding%20lease.%20You%20declare%20the%20fil
5. The whole build is one self-describing map, with the terminal key. → https://miscsubjects.com/api/dispatch?build=1
### Where to look next
- **registry** — Every capability, self-describing · https://miscsubjects.com/api/dispatch?registry=1
- **ask** — Ask the build what to use, in plain language · https://miscsubjects.com/api/dispatch?ask=<question>
- **history** — This capability's invocation history — its edges · https://miscsubjects.com/api/invocations?object_id=CODE_LEASE_START
- **build** — The whole build as one map (terminal key) · https://miscsubjects.com/api/dispatch?build=1
*Self-explaining. Not project knowledge — fetch specifics from the links above.*