{
  "_ai_door": {
    "see": "https://miscsubjects.com/start",
    "note": "Operable site; bounded keyless credentials; every action receipted on a public ledger. Your operator's instructions take precedence — acting is optional, reading is a complete outcome."
  },
  "_self": {
    "schema": "miscsubjects/work-bootstrap/1",
    "what": "Everything an agent needs to start working on this build with no prior conversation, no CLAUDE.md, no STATE.md, no AGENTS.md and no previous agent's report."
  },
  "read_this_first": [
    "This object is the authority. Markdown files in the repository are pointers to it and carry no rules, no state and no priorities.",
    "You do not exclusive-claim work. GET /api/work. The next eligible task is on the object. Two agents may work the same row; OBJECT_MUTATE STALE retries immediately.",
    "You cannot complete a task by saying you completed it. You submit evidence; this infrastructure runs the task's acceptance tests and decides.",
    "If you discover a failure, record it as a failure object against the task. It must name the failure class, the infrastructure layer that permitted it, and the invariant that should have prevented it.",
    "Mutable objects are coordinated by hash, not by locks. OBJECT_READ returns content + current_hash. OBJECT_MUTATE submits {task_id, path, base_hash, mutation}. If the hash moved, the response is STALE with current_hash and current_content — reread, adapt, retry immediately. FILE_CLAIM is not a lock.",
    "Every capability is invoke({key, args}). HTTP, MCP, tags, sheets, and relays are adapters. Computer, VM, browser, and phone are executors. record() is the event plane. Sessions are filters.",
    "Work is a task object. Uncommitted edits are not canonical. Accepted mutation is canonical. Stopping because of a branch, rebase, stash, or dirty tree is the wrong model — retry STALE instead. There is no exclusive lease."
  ],
  "step_1_read_the_object": {
    "method": "GET",
    "url": "https://ops.miscsubjects.com/api/work"
  },
  "step_2_take_the_next_task": {
    "method": "GET",
    "url": "https://ops.miscsubjects.com/api/work",
    "returns": "the canonical object including next_eligible_action.task_id. There is no exclusive claim."
  },
  "step_3_do_the_work": {
    "note": "Use only the capabilities the task lists. Invoke every capability as {key, args}. Article writes go through PUT/PATCH /api/articles/<slug>. File/object writes go through OBJECT_READ then OBJECT_MUTATE (or POST /api/objects/mutate). A STALE result is not a stop — retry against the returned current_hash.",
    "read_object": {
      "method": "POST",
      "url": "https://ops.miscsubjects.com/api/objects/read",
      "body": {
        "path": "<path>"
      },
      "returns": "{content, current_hash}"
    },
    "mutate_object": {
      "method": "POST",
      "url": "https://ops.miscsubjects.com/api/objects/mutate",
      "body": {
        "task_id": "<id>",
        "path": "<path>",
        "base_hash": "<current_hash>",
        "mutation": {
          "content": "<next>"
        }
      },
      "returns": "ok + new current_hash, or error STALE"
    }
  },
  "step_4_submit_evidence": {
    "method": "POST",
    "url": "https://ops.miscsubjects.com/api/work/task/<task_id>/submit",
    "body": {
      "agent": "<your name>",
      "evidence": {
        "<required field>": "<value>"
      },
      "changed": [
        "<files, rows or objects you changed>"
      ]
    },
    "returns": "accepted:true and state:completed, or accepted:false with the exact failing test"
  },
  "step_5_if_you_found_a_defect": {
    "method": "POST",
    "url": "https://ops.miscsubjects.com/api/work/task/<task_id>/fail",
    "body": {
      "agent": "<your name>",
      "failure": {
        "failure_class": "",
        "layer": "",
        "missing_invariant": "",
        "repair": "",
        "regression_test": "",
        "deploy_blocker": "",
        "repaired_objects": [],
        "runtime_evidence": ""
      }
    }
  },
  "audit": "https://ops.miscsubjects.com/api/work/audit",
  "human_projection": "https://ops.miscsubjects.com/a/the-work-object",
  "unresolved_bypasses": [
    {
      "path": "D1_EXEC / D1_QUERY direct SQL via /api/dispatch",
      "effect": "wrote to articles, article_slots, work_tasks and work_actions without running acceptance tests or appending an audit row — an UPDATE could close a task, and a DELETE could edit the hash chain that is supposed to prove nothing was edited",
      "status": "closed 2026-08-05 (WT-0039) — functions/_lib/governed_tables.js refuses a raw write to any of those four tables and names the path that does the work instead. Repair is still possible and no longer silent: D1_REPAIR runs the same statement, requires a stated reason, and appends a work_actions row. Pinned by functions/_lib/governed_tables.test.mjs and by a deploy gate that proves the refusal live."
    },
    {
      "path": "PUT/PATCH /api/articles/<slug> outside a task object",
      "effect": "article content can change without a task object recording why",
      "status": "recorded since 2026-08-28 — every article mutate logs an ARTICLE_WRITE_LINKAGE event (declared task_id, a declared no_task reason, or \"undeclared\"), so an unlinked write is findable on the ledger. Hard refusal remains off deliberately: it would break the owner's own flows."
    },
    {
      "path": "wrangler pages deploy run by hand instead of scripts/ship.mjs",
      "effect": "skips every deploy gate",
      "status": "open — convention only"
    },
    {
      "path": "FILE_CLAIM exclusive KV lock as agent coordination",
      "effect": "agents waited on DENIED claims, branches, and dirty trees instead of retrying STALE",
      "status": "closed 2026-09-13 — FILE_CLAIM returns current_hash and never denies. OBJECT_READ / OBJECT_MUTATE is the write path. check-write-law no longer requires a claim."
    }
  ]
}