Skip to content

Claims: name an unsupported lease schema - #811

Merged
Deicyde merged 2 commits into
mainfrom
fix/777-unsupported-lease-schema
Nov 14, 2026
Merged

Deicyde merged 2 commits into
mainfrom
fix/777-unsupported-lease-schema

Conversation

@Deicyde

@Deicyde Deicyde commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #777.

Premise

  • User: an agent or lead reading autoform claim list, or a refusal from claim acquire or claim release, on a board that holds refs Autoform didn't write.
  • Problem: a claim ref whose lease is a JSON object with a schema other than autoform-claim/v1 is reported as claim 'K' has an invalid lease schema, the message a damaged autoform-claim/v1 lease also gets. claim list shows it as schema: "unreadable". Nothing names the schema it found, so the run in Agent feedback from a Formalize run: autoform claim list --worker-id <worker> reports `has an invalid lease schema… #777 had to read the ref's commit message to learn that its refs were deliberate markers.
  • Replaces: that message, for this case only, with claim 'K' has unsupported lease schema 'X', where X is the repr of the value found.
  • Deletes: nothing.

Line delta: +28 in total.

  • code: +3 (autoform_cli/claims.py);
  • docs: +5 (CHANGELOG.md);
  • tests: +20 (tests/test_claims.py).

What changes

  • Messages. _parse_lease raises the new message when the lease is a JSON object with a schema key whose value isn't autoform-claim/v1. Every other message stays: has invalid lease JSON for a lease that doesn't parse, and has an invalid lease schema for one that isn't an object, has no schema, or is an autoform-claim/v1 lease with a bad field. The repr escapes control characters, as the key's already does.
  • Held claims. The lease is still a MalformedLeaseError, so what counts as held doesn't change. claim acquire and claim release still refuse it, exit 1, now with the new message. claim list still gives _malformed: true and schema: "unreadable", with the new message in _error, since the listing's JSON shape is a contract that a script may match on. autoform move and project worktrees still treat it as possibly held.
  • Docs. None. No doc quotes these messages, and the claim contract tells a reader to act on _malformed.
  • Tests. test_a_lease_of_another_schema_is_named_and_still_held plants a lease with schema legacy-block/v1. It checks that read, acquire and release each raise exactly the new message, and that claim list exits 0 with that message in _error, schema still unreadable and _malformed true.
  • CHANGELOG. One line under Unreleased's Fixed, added in a second commit once the PR had its number:
### Fixed

- **A claim whose lease has another schema names it.** A claim ref whose lease
  is JSON with a schema other than `autoform-claim/v1` was reported as having
  an invalid lease schema, so telling a ref another tool wrote from a damaged
  lease meant reading its commit. The message now says the schema is
  unsupported and names it: `claim 'K' has unsupported lease schema 'X'` (#811).

Checks

Posted by Claude Code, at Jack's request.

A claim ref whose lease is a JSON object with a schema other than
autoform-claim/v1 was reported as "has an invalid lease schema", as a damaged
v1 lease is, so telling a ref another tool wrote from a damaged lease meant
reading its commit (#777). It now raises "claim 'K' has unsupported lease
schema 'X'", with the repr of the value found.

It is still a MalformedLeaseError, so what counts as held doesn't change:
acquire and release refuse it, and claim list gives _malformed: true with
schema "unreadable", its message in _error. Every other message stays.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2026
@Deicyde

Deicyde commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

No blockers at 08d34c9.

  • _parse_lease names the schema only for a JSON object whose schema is present and isn't autoform-claim/v1.
  • A damaged v1 lease, a non-object and a lease with no schema keep "has an invalid lease schema".
  • Every such lease is still a MalformedLeaseError, so nothing that was held is freed.
  • I checked seven leases by direct calls, on main at ce0c81c and at this head. The new test fails against main's message, and CI is green.

Two nits:

  • The repr is unbounded. A 5,000-character schema gives a 5,044-character refusal and _error; capping the quoted value keeps both readable.
  • A non-string schema reads as Python (None, True), where the lease is JSON (null, true). json.dumps would keep the lease's own spelling.

Posted by Claude Code, at Jack's request.

@Deicyde
Deicyde marked this pull request as ready for review November 14, 2026 04:38
@Deicyde
Deicyde merged commit fbcd3e2 into main Nov 14, 2026
10 checks passed
@Deicyde
Deicyde deleted the fix/777-unsupported-lease-schema branch November 14, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent feedback from a Formalize run: autoform claim list --worker-id <worker> reports `has an invalid lease schema…

1 participant