amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
One user-space repair task per eligible HWE debug-diag / compile-deploy base
ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content
filter. Each ships a public spec with a check-to-basis table, at least two
defects with single-fix fixtures, a symptom-masking fixture and an alternative
correct implementation. Claude re-checked all 320: structure, the HWE quality
items and trace6 Docker calibration receipts against current digests
(320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120
ad-hoc family names; the next batch maps them to the canonical list.
The batch's 1,256-line progress log stays in its factory report and the
36-local branch batch15-hwe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:55:56 +08:00

3.0 KiB

Controlled lock port contract

  1. This is a deterministic single-threaded simulation of an exclusive lock port. Owners are the integers 1 through 4. Lock IDs are 0 through 5, with respective levels 10, 20, 35, 50, 80, and 120. A lock is free when its port owner is 0.
  2. Each owner has an ordered held stack, initially empty. A successful T owner lock acquires a free lock only when its level is strictly greater than the level of every lock already held by that same owner. It appends the lock to that owner's stack and sets the port owner to that owner. Owners can interleave commands independently.
  3. A successful D owner lock requires that the lock be the top of that owner's held stack. It releases the port lock and removes exactly that top item. The next permitted level is determined by the actual remaining stack, including when levels are skipped. A different owner may hold a lock of any level, subject only to exclusive port occupancy.
  4. B owner lock... takes a nonempty list of one to six locks in the given order as one transaction. It has the same per-lock rules as consecutive T commands. If any acquisition would fail, it returns that failure code and leaves both all owner stacks and all port owners exactly as before the B command. A successful batch appends all of its locks.
  5. A owner releases that owner's entire stack from top to bottom. A successful release changes no other owner's stack or port ownership. Z resets every stack and every port owner to the initial empty state.
  6. T, D, B, and A return 0 on success. A bad owner or lock ID returns -22. Taking a level at or below the requesting owner's current top returns -35. Taking an otherwise admissible level whose port lock is held returns -16. Dropping a lock that is not the requesting owner's top returns -35 if it is deeper in that stack; it returns -1 if another owner holds it; it returns -2 if free. A failed command changes no stack or port owner.
  7. When several failures are possible for T or each B step, evaluate invalid IDs first, then order, then port occupancy. For D, evaluate invalid IDs first, then a lock deeper in the requesting owner's stack, then the port's owner/free state. B reports the first failing step after undoing earlier steps.
  8. V owner reports that owner's stack in acquisition order and its top level, or 0 for an empty stack. For an invalid owner, it reports an empty stack and level -22. P lock reports the actual port owner, or -22 for an invalid lock. C reports the number of occupied port locks. S reports all port owners and all owner stacks. The observations are read-only and must reflect real state; a failed operation must not be hidden from them.
  9. I audits port ownership against stacks, stack order, and duplicates. F and G preview the per-owner acquire gate using the same status priority as T; E previews releases with D priority. These read-only observations and J counters are defined precisely in the protocol. They cannot change ownership or a stack.