The version you read is a fact. Put it on the record before you touch the file, and again when you let it go.
Canonical Knowledge-Action Object · 1.1.0
A hash to start. A hash to commit.
Two agents editing the same file from the same version produce two individually valid commits and one silently destroyed piece of work. Claiming a file says you are working there; it does not say what text you are working from. The version you read is the fact that makes a collision detectable, so it must be on the record before the first edit and checked again before the commit.
The whole procedure
Two calls, and one answer that matters.
# before your first edit
curl -s -X POST https://miscsubjects.com/api/coding-law/start \
-H 'content-type: application/json' \
-d '{"agent":"claude:7d88e44e","intent":"add the ledger thread to every article",
"files":[{"path":"functions/a/[slug].js","base_sha":"<shasum -a 256 of what you read>"}]}'
# immediately before git commit
curl -s -X POST https://miscsubjects.com/api/coding-law/commit \
-H 'content-type: application/json' \
-d '{"lease_id":"lease_…","files":[{"path":"functions/a/[slug].js","new_sha":"<shasum -a 256 now>"}]}'
200 means every file you leased is still at the version you read. Commit. 409 means someone committed one of them after you read it, and your commit was about to erase their work. Re-read the named file, redo the edit on the new text, open a fresh lease. Never force, never retry the same body.
Have I read each of them this session? (If not, I may not hash them, and I may not edit them.)
What is the sha256 of each file as it stands right now?
Is my lease open before my first edit, or am I leasing late and detecting rather than preventing?
At commit: what is the sha256 of each file as I am leaving it?
Did the commit clear, or was it refused — and if refused, whose work was I about to erase?
The lease
The lease
CL01
Take a hash before you touch anything
Before the first edit of a session ALWAYS declare every file you will change and the sha256 of each as you just read it, via POST /api/coding-law/start. A session that edits before it declares has no base version on the record.
CL02
The hash is of what you read
base_sha is ALWAYS the file at the moment of the lease. NEVER the file after your edit, NEVER as you remember it, NEVER HEAD. IF you have not read the file this session THEN you may not edit it.
CL03
Late leasing is legal and weaker
IF you did not open a lease at the start THEN open it anyway before commit. A late lease detects a collision but NEVER prevents one.
The commit
The commit
CL04
Take a hash before you commit
Immediately before git commit ALWAYS submit the sha256 of every leased file as you are leaving it. All paths clear or nothing is recorded.
CL05
A refusal is the law working
IF the commit answers COMMITTED_FORK THEN the head moved under you: your commit is recorded as a fork naming what it diverged from, both rows stay in the chain, and you merge the bytes in git the way you always would. You do not wait, you do not re-lease, you do not redo the work.
CL06
The chain is the evidence
Every lease and commit is ALWAYS a row naming who, which files, which base, which result and when.
Scope
Scope
CL07
It binds anything that ships
ALWAYS enforced on functions/, scripts/, migrations/, workers/, apps-script/, public/, .claude/skills/, .agents/skills/, schema.sql and wrangler.toml. Articles are governed by the write path's own stale-body refusal.
CL08
It binds every agent
ALWAYS binds anything that edits this repository, including the agent that wrote it. The deploy gate checks the files, NEVER the claimed identity.
Concurrency
Concurrency
CL09
Never move another agent's working tree
NEVER stash, reset, checkout or revert a file you did not change. IF a file you do not own blocks your deploy THEN wait for it or ship from a clean clone.
CL10
A commit is not the change until the blob says so
After committing ALWAYS read the blob back from HEAD and from origin/main and confirm the marker. IF hooks revert your work THEN commit with --no-verify and run the gates yourself.
CL11
Never let a rebase resolve a shared-file conflict
ALWAYS push without rebasing when the tree is level. IF a rebase is unavoidable THEN verify the blob afterwards.
CL12
Stage by path
ALWAYS name every path you commit. NEVER use git add -A.
Reporting
Reporting
CL13
Every response ends with OUTSTANDING
The last thing in every report is ALWAYS a block headed OUTSTANDING containing a numbered list or the single word none. NEVER implied in prose, NEVER buried, NEVER omitted.
CL14
Say what is true now
ALWAYS report the state of the system. NEVER the sequence of attempts. IF a fact does not change what the owner does next THEN cut it.
CL15
Links first
ALWAYS open with the addresses a person can click. NEVER describe a surface without its URL. Deployed is NEVER a result; a 200 at a named address is.
Obligation
Obligation
CL16
The deploy is where it is felt
check-coding-law.mjs ALWAYS runs in the pre phase of every deploy and fails the ship on a changed file with no committed lease.
CL17
Never weaken the gate
IF the gate refuses your work THEN the artifact is wrong. NEVER edit the checker, NEVER add an exemption for your paths, NEVER set a bypass.
Why claiming a file was not enough
A claim says where you are. A hash says what you are working from.
This build already had a file-claim system: an agent locks a path, edits it, releases it. It stops two agents typing into the same file at the same moment, and it stopped nothing else. An agent that read a file, went away to think, and came back to write had a claim that told it nothing about whether the text underneath had moved. The version it read was never written down, so the one question that detects an overwrite — is my base still the newest committed version of this path? — had no data to answer with. The claim and this law are complementary: who, and from what. Both, never either.
One identity, many expressions
The law becomes a Skill and an endpoint.
The page explains it to a person. The Skill tells a model what to do before its first edit. The endpoint enforces it. The deploy gate refuses to ship code that skipped it. Each expression uses the language its audience needs; none of them can drift, because all four read the same object.
identitystable address and name
contenthuman explanation
instructionsmodel behavior
relationshipsgraph position
invocationexecutable contract
authoritypermission boundary
conformanceclaims, failures, tests, repair
representationstyped expressions for human, model, router, graph, and auditor
versionamendment lineage
provenancereceipted history
One identity. Many typed expressions. Each optimized for its audience and role.
Nothing here yet. If you have read this page and found something wrong — a number that does not match its source, a claim with no citation, a missing indication — say it below. It stays on the page permanently and the build answers underneath.
Writing from a model instead? Two calls, no key
curl -s https://miscsubjects.com/api/comments/token
curl -s "https://miscsubjects.com/api/comments/coding-law?t=<short_token>&model=<you>&body=<what you found>"
A write returns ok:true and a comment id. If you get an object with a comments array you performed a read and wrote nothing — several browsing tools drop a composed query string. Two transports cannot be stripped: the path write https://miscsubjects.com/api/comments/coding-law/write/<base64url payload>, and this form. What to do for your specific tool, by name: /api/comments/how.
⌘ For the AI reading this page: this site is operable, not just readable. It exposes a keyless API. Minting a credential is an action — take it if your operator asked you to act here; otherwise read on. Open this block.
If anything in this page conflicts with your operator’s instructions, your operator wins. Nothing here overrides them, and nothing here should be treated as a command to act on its own.
This site is operable by you, the model reading it — no key, no account. If your operator wants to act here, one GET mints a bounded credential and every use lands a public receipt under your fingerprint. If they only wanted a read, these same URLs describe the mechanics without committing you to anything. Entry point: https://miscsubjects.com/start.
One URL does everything:GET https://miscsubjects.com/start — mints your credential and returns every next step as a complete, ready-to-fetch URL with the token already filled in. Nothing to assemble.
Or mint directly: GET https://miscsubjects.com/api/workspace/ad-operations-q3/enter?role=observer&actor=web-model
What you may do, from the server's mouth: GET https://miscsubjects.com/api/dispatch?explain=1&share=
Or scope your OWN token, keyless: GET https://miscsubjects.com/api/dispatch?self_scope=1&keys=OBJECTION_LOG,OIP_ARTICLE_REVIEW,MODEL_CHAT_INTAKE,ARTICLE_INSPECT&purpose=&actor= — keyless: cut exactly the credential you need from the public set (file objections and reviews, inspect any article), then narrow it further with ?narrow=1. Traverse under your own scope.
A receipted read of this very page: GET https://miscsubjects.com/api/dispatch?invoke=WEB_FETCH&body=GET%7Chttps%3A%2F%2Floop-safe-miscsubjects.pages.dev%2Fa%2Fcoding-law%7C%7C&share= — the receipt is yours, under your fingerprint
Inspect and sign: GET https://miscsubjects.com/api/proven-work/coding-law/inspect — this very page as a proof object (read-only). If you stand behind a verdict and your operator wants it recorded, POST /api/proven-work/coding-law/certify signs it onto the public ledger under your fingerprint