host: carry and explain task outcomes #104

Merged
mikluko merged 2 commits from host-done-fields into main 2026-11-16 12:48:00 +00:00
Owner

Summary

 done(result)
+  blocked?  -> HostService.Done.Blocked
+  commit?   -> HostService.Done.Commit
+  branch?   -> HostService.Done.Branch

 result(task)
+  closed: state and outcome in words, then the worker's result
+  abandoned: failed, then the server's reason
   open: unchanged

done refuses an incomplete commit/branch pair under the same condition as gcwork.Done.

Evidence

  • Before: the new MCP tests failed with only result in the done schema, rejected the new arguments, and returned outcome notes without explaining them.
    After: go test ./... -race -count=1 passes.
  • make lint passes (buf lint, buf format --diff --exit-code, go vet ./...).
  • go run sarak.sh/mikluko/changelog/v2/cmd/changelog@latest -base main reports valid=true.

Merge Danger

Door: Two-way.

Blast Radius: Room work tools.

Only the host's MCP schema, Done request fields, and result wording change; the server and proto are unchanged.

## Summary ```diff done(result) + blocked? -> HostService.Done.Blocked + commit? -> HostService.Done.Commit + branch? -> HostService.Done.Branch result(task) + closed: state and outcome in words, then the worker's result + abandoned: failed, then the server's reason open: unchanged ``` `done` refuses an incomplete commit/branch pair under the same condition as `gcwork.Done`. ## Evidence - **Before:** the new MCP tests failed with only `result` in the `done` schema, rejected the new arguments, and returned outcome notes without explaining them. **After:** `go test ./... -race -count=1` passes. - `make lint` passes (`buf lint`, `buf format --diff --exit-code`, `go vet ./...`). - `go run sarak.sh/mikluko/changelog/v2/cmd/changelog@latest -base main` reports `valid=true`. ## Merge Danger **Door:** Two-way. **Blast Radius:** Room work tools. Only the host's MCP schema, `Done` request fields, and `result` wording change; the server and proto are unchanged.
host: carry and explain task outcomes
All checks were successful
test / changelog (pull_request) Successful in 5s
image / image (pull_request) Successful in 17s
test / go (pull_request) Successful in 1m34s
8662d8725d
The commit/branch preflight mirrors gcwork.Done: blocked takes
precedence, so only non-blocked calls reject an incomplete pair.

Assisted-By: Kimi <noreply@moonshot.ai>
Author
Owner

Review at 8662d87, by the reviewing session (specs-58). The suite is green here under go test -race ./..., internal/host ten times with GOMAXPROCS=1.

The host's refusal matches the server's: gcwork.Done takes blocked first and then refuses a commit without its branch or the reverse, in the same words, and the host refuses the same pair unless blocked. The fields reach HostService.Done as they are. An outcome the host does not know leaves result as it was, so an older server is unaffected.

Three changes before it merges.

1. abandoned says the same thing twice, and the first is not the reason

The server's reasons already begin "ended without a result" (internal/taskwatch: "ended without a result: timed out after 15m0s", "ended without a result: its model failed 3 turns in a row, the last with: …"), so the foreman reads

Task sa-1 is closed. Outcome: abandoned — failed: ended without a result.
Reason from the server:
ended without a result: timed out after 15m0s

Let the outcome's words say who ended it and the reason follow once: "abandoned — failed: the server ended the worker's session before it gave a result", then the reason. The README and the result tool's description carry the same phrase and change with it.

2. With blocked, a commit and a branch are dropped in silence

The server records gc.work_commit and gc.work_branch only for shipped; a done with blocked and a commit keeps neither, and the agent is told "The task is closed". Either refuse that combination in the host as the half-given pair is refused ("a blocked task records no commit: put it in the result"), or say in the done tool's description and the README that with blocked the commit and branch are not recorded. Refusing is the one that cannot be misread; a test either way.

3. A commit that is no commit makes a task shipped

commit is any string. A worker that writes commit: "none" or "n/a" with a branch closes its task as shipped with that in gc's record, and the workers here are a smaller model following a schema. Refuse in the host a commit that is not a commit's id (7 to 40 hexadecimal digits) with words that say so, and a branch that is empty after trimming. Tests for "none", a full id and an abbreviated one.

Small:

  • The README's "outcome that call recorded—no-op, shipped or blocked—and" uses dashes with no spaces; the file's sentences use commas or parentheses.

On the description leading goose to set blocked on a no-op: "completing it without a commit is not blocked" in both the tool's description and the field's is as plain as it can be made; the proof is a worker's run, which the reviewing session reads when it is in the city.

It will conflict with #105 in CHANGELOG.md; whichever is second rebases.

Review at 8662d87, by the reviewing session (specs-58). The suite is green here under `go test -race ./...`, `internal/host` ten times with `GOMAXPROCS=1`. The host's refusal matches the server's: `gcwork.Done` takes `blocked` first and then refuses a commit without its branch or the reverse, in the same words, and the host refuses the same pair unless `blocked`. The fields reach `HostService.Done` as they are. An outcome the host does not know leaves `result` as it was, so an older server is unaffected. Three changes before it merges. ### 1. `abandoned` says the same thing twice, and the first is not the reason The server's reasons already begin "ended without a result" (`internal/taskwatch`: "ended without a result: timed out after 15m0s", "ended without a result: its model failed 3 turns in a row, the last with: …"), so the foreman reads Task sa-1 is closed. Outcome: abandoned — failed: ended without a result. Reason from the server: ended without a result: timed out after 15m0s Let the outcome's words say who ended it and the reason follow once: "abandoned — failed: the server ended the worker's session before it gave a result", then the reason. The README and the `result` tool's description carry the same phrase and change with it. ### 2. With `blocked`, a commit and a branch are dropped in silence The server records `gc.work_commit` and `gc.work_branch` only for `shipped`; a `done` with `blocked` and a commit keeps neither, and the agent is told "The task is closed". Either refuse that combination in the host as the half-given pair is refused ("a blocked task records no commit: put it in the result"), or say in the `done` tool's description and the README that with `blocked` the commit and branch are not recorded. Refusing is the one that cannot be misread; a test either way. ### 3. A commit that is no commit makes a task `shipped` `commit` is any string. A worker that writes `commit: "none"` or `"n/a"` with a branch closes its task as shipped with that in gc's record, and the workers here are a smaller model following a schema. Refuse in the host a `commit` that is not a commit's id (7 to 40 hexadecimal digits) with words that say so, and a branch that is empty after trimming. Tests for "none", a full id and an abbreviated one. Small: - The README's "outcome that call recorded—`no-op`, `shipped` or `blocked`—and" uses dashes with no spaces; the file's sentences use commas or parentheses. On the description leading goose to set `blocked` on a no-op: "completing it without a commit is not blocked" in both the tool's description and the field's is as plain as it can be made; the proof is a worker's run, which the reviewing session reads when it is in the city. It will conflict with #105 in CHANGELOG.md; whichever is second rebases.
host: validate done's commit metadata
All checks were successful
image / image (pull_request) Successful in 17s
test / changelog (pull_request) Successful in 5s
test / go (pull_request) Successful in 1m1s
377aef2ff4
gc records commit metadata only for shipped work, so blocked calls
reject it rather than having the server drop it.

Assisted-By: Kimi <noreply@moonshot.ai>
mikluko deleted branch host-done-fields 2026-11-16 12:48:01 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/roomcity!104
No description provided.