You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0972daa
Browse filesBrowse the repository at this point in the historyBrowse files
Accept a result or send it back from the Inbox Done list (#401) (#1155)
Owner: Dev2
Reviewer: Reviewer
Tip SHA: 0376e73Fixes#401
Related #1154
## Reproduce
A finished task is a *Needs you* card in the Inbox with one action,
**Open**. The host has `task-accept-result` (`core/src/host/tasks.js`)
but nothing calls it — `core/src/client/index.js` exposes no
`acceptTaskResult` and `inbox.js` draws no result action — so the
requester cannot accept from the card. There is no send-back endpoint at
all: the only way to reject a result is `task-cancel`, which throws the
work away instead of telling the Bot what to change. A result also
cannot carry evidence (`task-return` stores `{kind, summary}` only), and
the card shows neither the evidence nor which Bot/model produced it.
Tests are the three new cases: `core/test/tasks.test.js` #27 (`a
returned result carries at most five http(s) links…`) and #28 (`the
requester sends a result back with a note…`), `core/test/inbox.test.js`
#24 (`a result card is accepted or sent back in place…`).
## What changed
- `core/src/host/tasks.js` — `result-ready` may now also go to
`working`; `task-return` reads evidence links (`readLinks`: at most five
`http(s)` URLs, deduped, in order, the rest dropped; a non-list refused
**before** the transition so a malformed write leaves the task where it
is) into `result.links`; new `task-send-back` needs a note (1..500,
`bot/invalid` without one), requires `result-ready`, moves the same task
to `working` with `followUp: {note, at}` and the `by: 'sent back'` actor
entry.
- `core/src/host/authz.js`, `core/src/host/channel.js` —
`task-send-back` in the explicit allow-list and in the channel's
`task-*` case list.
- `core/src/client/index.js` — `acceptTaskResult(id)` /
`sendBackTask(id, note)`.
- `core/src/client/inbox.js` — `inboxAnswer` answers a `status:
'result'` card with `'accept'` or `{note}`; a `ResultActions` row
(**Send back** → one-line box `What should change` → **Send it back**,
plus **Accept**), the box kept in a card-keyed slot so a roster or clock
poll does not close it (same shape as #1140's short answer);
`task.result.links` drawn as evidence links; `task.followUp.note` drawn
as *Sent back: …*; the producing Bot's model added to the card's meta
line; four CSS rules.
- `core/src/client/i18n.js` — Chinese copy for the five new strings, so
`core/test/i18n.test.js`'s "every literal the client translates has a
Chinese entry" still holds.
- `core/client.js` — rebuilt from `core/src/client/` (`node
scripts/build-client.mjs`).
- `patches/ds-bot/` — the series regenerated for the touched files
(`files/` verbatim copies; `0001`/`0003`/`0005`/`0008` sections
rewritten by `diff -u`, see Risk).
- `docs/subsystems/core-host.md` (endpoints, `result.links`,
`task-send-back`), `docs/subsystems/core-client.md` (the inbox row and a
*Done is the acceptance surface* invariant), `docs/subsystems/team.md`
(channel allow-list).
- `changelog.d/401-accept-or-send-back-a-result.added.md` —
user-visible.
Not in this PR: writing the verdict back to the issue/PR the task came
from (the other half of the owner's phase 1 — a task has no pointer to
an issue/PR and the host has no GitHub write path). Tracked as #1154, so
**judge this tip as the card + record half**, not as phase 1 complete.
## What I ran
On this tip, base `75ca7ab9`, no `git` on this box:
- `cd core && node --import ./test/harness-resolve.mjs --test
--test-concurrency=1 test/tasks.test.js test/inbox.test.js
test/i18n.test.js test/at-menu.test.js test/reach-policy.test.js
test/bot-tasks.test.js test/kanban.test.js` → `# tests 88 / pass 88 /
fail 0 / skipped 0`
- `cd core && node scripts/build-client.mjs && node
scripts/build-client.mjs --check` → exit 0 both
- `node scripts/ds-bot-patches.mjs check` → `skipped pin (no git): the
tree hash cannot be computed here`, `ok 10 patches apply cleanly in
order`, `ok core/ equals ds-bot/ + patches/ds-bot/`
- `cd core && DSH_HARNESS=… node scripts/lint.mjs` → `Found 51 warnings
and 0 errors.` (the same 51 as base `75ca7ab9`; none in the files this
PR touches), then `arch-docs: FAIL — cannot diff against origin/main`
(no git here)
- `node scripts/lint-plugins.mjs` → ok
- `node .github/scripts/changelog.mjs check` → `39 fragment(s) in
changelog.d/ are well formed`
- `diff -rq` against a `75ca7ab9` tarball → exactly the 22 files of this
PR, nothing else (no ghost)
## Red without the source change
- Host: copy base `75ca7ab9`'s `core/src/host/tasks.js` over this tip's
→ `not ok 27` and `not ok 28`, `# pass 26 / # fail 2`; restored, `cmp`
identical.
- Client: copy base `core/src/client/inbox.js` over this tip's → `not ok
24` (`a result card is accepted or sent back in place…`), `# pass 23 / #
fail 1`; restored, `cmp` identical, `ds-bot-patches check` still both
`ok`.
## Not run
- `npm run verify` end to end: its `arch-docs` step needs `git` and
`origin/main`, which this box does not have. Both halves were run by
hand (above); CI's `tests-ok` is the terminal answer.
- The whole suite on this exact tip is in the body above; the eight
failures it reports are the same eight a pristine `75ca7ab9` reports on
this box (see the comment below).
## Risk
- `patches/ds-bot/0008-client-bundle.patch` is rewritten with `diff -u`
rather than `git diff` (no git here), so its hunk boundaries differ from
git's even though the content is the same: `check` proves
`core/client.js` still equals `ds-bot/ + patches`. The next Bot that
regenerates this file with git will rewrite that section — the same
shape as #1141's regeneration.
- A sent-back task keeps its previous `result` on the record
(deliberate: the note points at what was already there; the next
`task-return` overwrites it).
- `task-send-back` is a new channel name: an older host answers
`bot/not-found` and the client shows that error on the card; an older
client never calls it.
A finished task can now be accepted or sent back right in the inbox ([#401](https://github.com/ThinkFlowLab/FlyBot/issues/401)): the result card shows the Bot's evidence links and model, **Accept** closes the task as done, and **Send back** asks for one line about what should change and returns the same task to the Bot.
0 commit comments