Review round 1 (claude NOT PASS) corrections: - B2: the timer now watches a process - `--watch-pid`, or by default the nearest agent-CLI ancestor of the publishing command - and stops within one period once it is gone, so a crashed agent stops heartbeating and is closed after K x N; a remote runner watches itself. Documented as process liveness (an alive-but-stuck agent keeps heartbeating). - R1: `_wait_started` accepts an events.log `started` only when it carries the current dispatch token (loop jobs share one events.log). - R2: the remote runner ignores a re-sent dispatch of an attempt that already reached its terminal. - R3: registry.md EOF blank line (git diff --check clean). - R4: the ack error states the effective budget when the wall clock cut it. - P3: stop_timer verifies the pidfile pid is this job's timer before signalling; a retained state message keeps its own seq watermark so it can never make the monotonic guard drop its own event. - MULTI_AGENT_RULES.md timeout section updated for the contract. - tests: agent-process death stops the timer, recycled-pid safety, attempt-scoped started, re-sent dispatch; acceptance 3 now kills the agent process instead of the timer. Help captures refreshed (--watch-pid). The wrapper can be sourced with MAM_DELEGATE_JOB_NO_MAIN=1 for helper-level tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
47 lines
2.3 KiB
Plaintext
47 lines
2.3 KiB
Plaintext
usage: publish_event.py [-h] (--job JOB | --pick-pending)
|
|
[--agent-session AGENT_SESSION]
|
|
[--event {started,permission_required,progress,completed,error,cancelled}]
|
|
[--detail DETAIL] [--data DATA] [--retained]
|
|
[--registry-dir REGISTRY_DIR] [--attempts ATTEMPTS]
|
|
[--finalize-report PATH]
|
|
[--side-effect KIND=REFERENCE]
|
|
[--attempt-id ATTEMPT_ID]
|
|
[--expect-dispatch-token EXPECT_DISPATCH_TOKEN]
|
|
[--heartbeat N] [--no-state] [--watch-pid WATCH_PID]
|
|
[-v]
|
|
|
|
Publish a Job event to MQTT
|
|
|
|
optional arguments:
|
|
-h, --help show this help message and exit
|
|
--job JOB job id to publish for
|
|
--pick-pending auto-select a pending job for --agent-session
|
|
--agent-session AGENT_SESSION
|
|
session label used with --pick-pending
|
|
--event {started,permission_required,progress,completed,error,cancelled}
|
|
--detail DETAIL
|
|
--data DATA optional JSON object string
|
|
--retained force retain=True (auto for completed/error)
|
|
--registry-dir REGISTRY_DIR
|
|
--attempts ATTEMPTS
|
|
--finalize-report PATH
|
|
atomically finalize this report and declare its
|
|
completion manifest before publishing
|
|
--side-effect KIND=REFERENCE
|
|
evidence for an external side effect this job
|
|
performed
|
|
--attempt-id ATTEMPT_ID
|
|
attempt this finalization belongs to (default: the
|
|
job's current iteration)
|
|
--expect-dispatch-token EXPECT_DISPATCH_TOKEN
|
|
expected dispatch token for CAS verification
|
|
--heartbeat N after publishing, start a detached timer that
|
|
publishes a `progress` heartbeat every N seconds until
|
|
the job ends (Issue #18; not with a terminal event)
|
|
--no-state do not publish the retained <topic_prefix>/state
|
|
message
|
|
--watch-pid WATCH_PID
|
|
bind the heartbeat timer to this process (default: the
|
|
nearest agent-CLI ancestor; 0 = no watch)
|
|
-v, --verbose
|