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>
5.0 KiB
5.0 KiB
Timer service adapter contract v1
- This is a deterministic C++17 software service port. It models callback-owned
clients and one asynchronous request, not ROS/DDS, hardware or elapsed real time.
The port clock starts at zero and advances only through
A delta(0..1000000). Tested traces have at most 10000 commands and clock at most 1000000000. N capacityconstructs a fresh port and adapter, capacity 1..16. A previous adapter is stopped before replacement.B timeout gain routestarts a stopped adapter; timeout 1..1000, gain -100..100, route 0..15. Invalid parameters return -2 without modifying state. Starting an already running adapter returns -3. Successful start resets the adapter's statistics, sequence and result journal; it does not reset the port clock or cumulative port statistics.T payload delay failrepresents one timer callback, payload -1000000..1000000, delay 0..1000, fail 0/1. Invalid parameters return -2 and do not count callbacks. Valid callbacks increment callbacks, even when stopped (return 2) or busy (increment skipped, return 1). A callback first collects a previous request at the current clock, then submits one new request if running and idle (return 0). Request sequence starts at 1 each successful B; only successful submissions consume a sequence. An unavailable client returns -1 and counts rejected.- A submitted request becomes ready at submission clock + delay. On collection,
a ready response wins over its timeout, including equality. Success is status
0 and value
payload * gain + route * 101 + sequence; a service failure is status 1 and value 0. Before readiness, clock >= submission clock + timeout yields status 2 and value 0, with port cancellation. Otherwise it stays pending.Aadvances the port and collects; it never creates requests. A delay-zero request is collected at the next collection operation, not inside submission. Xstops: if pending, cancel it and append status 3/value 0 immediately, regardless of readiness. Close all adapter-owned clients. Repeated X is a no-op. Preserve the completed journal and statistics. The destructor also stops. A stopped adapter has no pending request and owns zero live clients.- Each terminal result is appended exactly once in launch order as
(sequence,payload,status,value).Oprints the whole journal without draining it. Statistics are callbacks/launched/skipped/rejected/succeeded/failed/ timed_out/canceled; terminal result counts partition launched minus pending. - Client strategy is free: retain and reuse one idle client, or create a client for a request and destroy it after settlement. At every observable command boundary, live clients <= 1 while running and == 0 while stopped; busy clients equal pending (0/1). No port exhaustion, invalid-handle operations or errors are permitted for valid traces. A capacity-one port must support arbitrarily many sequential callbacks. Created count is deliberately not fixed.
- The port uses positive generation tokens, rejects stale tokens, rejects
destruction while busy, and tracks created/destroyed/submitted/replied/
canceled/exhausted/errors. For adapter traces, created-destroyed=live,
submitted is cumulative launched, replied counts status 0/1 results, canceled
counts status 2/3 results.
Pexposes these raw counters. Repeated start/stop and different configurations must not reuse an outstanding request or stale result from another session. SprintsS running pending next_sequence callbacks launched skipped rejected succeeded failed timed_out canceled.PprintsP clock capacity live busy created destroyed submitted replied canceled exhausted errors.OprintsO countfollowed by onesequence payload status valuerow per result.N,B,T,A,Xprint their letter and return code (N/A/X use 0). One command per LF-terminated line; fields are decimal integers separated by ASCII space or TAB; CR is allowed at line end. Empty lines are ignored. Output numeric tokens allow optional +/-, arbitrary leading zeros, space/TAB separators, optional leading/trailing space/TAB, and CR at line end. Letter labels and field counts are fixed. Extra stdout is invalid; stderr is unrestricted diagnostics and ignored.ServicePortandTimerAdapterdeclarations are in the public headers. The console is an observer only: it prints API return values, result records and real port counters. It has no expected values or assertions. Formal grading rebuilds onlytimer_adapter.hppandtimer_adapter.cppagainst the frozen public port and console. No network, ROS installation, real sleeps, files outside the current directory or runtime downloads are needed.LprintsL countand the current live client table astoken busy readyrows in slot order. Tokens are positive generation identifiers; busy is 0/1.readyis the submission clock + delay while busy; it is unspecified while idle. The table is an observation of the port, not adapter-reported ownership.