Commit Graph

42 Commits

Author SHA1 Message Date
Codex eb5bada0d1 fix(v0.2): device-pod output.text evidence read-only selectors for #773
Tracks pikasTech/HWLAB#773. PR #765 fixed selector confusion but did
not touch cloud-api evidence propagation. This change closes the
real root cause and adds the read-only evidence selectors that #760
follow-up called for.

cloud-api (internal/cloud/access-control.ts):
- DEVICE_JOB_INTENTS adds workspace.evidence and debug.evidence.
- DEVICE_JOB_READ_ONLY_SUB_ACTIONS = { status, output, wait, cancel,
  evidence } and DEVICE_JOB_ACTIONABLE_INTENTS = { workspace.build,
  debug.download } make the mutating-intent / sub-action matrix
  explicit.
- _deviceJobRequiresReason(intent, args, reason) returns false when
  the caller already provided reason OR when the actionable mutating
  intent is paired with a read-only sub-action. debug.reset and other
  non-actionable mutating intents still always require reason.
- executorOutputPayload now also surfaces output.summary,
  nestedOutput.summary, evidence.text, evidence.logTail and
  evidence.summary as body.output.text, so a dispatcher that
  includes the host logTail / buildSummary in its result becomes
  visible to the Code Agent without a separate bootsharp dance.

device-pod executor (cmd/hwlab-device-pod/main.ts):
- gatewayDispatchText also walks result.evidence.{text,logTail,
  summary}, dispatch.message (only when dispatchStatus=completed),
  dispatch.summary, result.summary and dispatch.buildSummary before
  falling back to JSON.stringify.
- deviceHostArgs maps workspace.evidence / debug.evidence to the
  host device-host-cli evidence subcommands.

device-host-cli (skills/device-pod-cli/assets/device-host-cli.mjs):
- new readJobEvidence(kindPrefix, requestedId, { tail, full,
  target }) reads the most recent (or specified) keil-build /
  keil-download job log file and returns it as keil-build.evidence /
  keil-download.evidence. tail defaults to 200, --full for entire
  log. Missing job returns ok=false but does not throw.
- workspace build evidence and debug-probe download evidence now
  wired in main() and help text.

device-pod-cli (tools/src/device-pod-cli-lib.ts):
- selectorCheatSheet adds the evidence row and clarifies that
  build/download status/output/wait/cancel/evidence are read-only
  and do NOT need --reason. build/download start still require
  --reason. usage examples now include the two evidence selectors.
- failed-fast selectors are unchanged; existing 26 tests still pass.

SKILL.md (skills/device-pod-cli/SKILL.md):
- Selector Cheat Sheet adds workspace.evidence and
  debug.evidence rows.
- #773 follow-up note: --reason is now required only for
  mutating sub-actions, not for the read-only ones.

cloud-api tests (internal/cloud/access-control.test.ts):
- workspace.evidence and debug.evidence must be in DEVICE_JOB_INTENTS.
- _deviceJobRequiresReason signature and the read-only / actionable
  branch table.
- executorOutputPayload must look at evidence and summary fields
  in addition to text. 3 new tests; pre-existing 4 workbench
  failures are unrelated to this change and reproduce on the
  unchanged v0.2 base.

Verification (host-side, G14 /root/hwlab-v02, source=0cf9a8c6):
- bun test tools/device-pod-cli.test.ts → 26/26 pass.
- bun test internal/cloud/access-control.test.ts → 23 pass,
  4 pre-existing workbench failures (unchanged on v0.2 base).
- bun test cmd/hwlab-device-pod/main.test.ts → 7/7 pass.
- node --check skills/device-pod-cli/assets/device-host-cli.mjs
  → syntax OK.

Hot probe: live v0.2 cloud-api at 74.48.78.17:19667 confirmed
job_devicepod_804c5db4... (workspace.build) returned
text="", bytes=0, output={} before this change. After the
executor text-extraction update and the new evidence selector,
a follow-up workspace.build start + build evidence will surface
the host logTail / buildSummary in body.output.text without
requiring bootsharp + host file fallback.

Tracked-by: pikasTech/HWLAB#773
2026-06-03 21:57:39 +08:00
Codex da25cb4c02 feat: align session sidebar and cli management 2026-06-03 09:47:52 +08:00
Codex 9f287fa0d9 fix: allow code agent workspace concurrency 2026-06-02 21:54:28 +08:00
Codex 39562d9c02 fix: clear stale continuation after thread resume failure 2026-06-02 20:12:01 +08:00
Codex bacfa24289 fix: replace device pod lease with api key 2026-06-02 18:11:32 +08:00
Codex 11dc7df502 fix: surface nested devicepod executor output 2026-06-02 15:03:41 +08:00
Codex 36e4ba2068 Merge remote-tracking branch 'origin/v0.2' into fix/v02-workbench-orphan-active-trace
# Conflicts:
#	docs/reference/spec-v02-hwlab-cloud-api.md
#	internal/cloud/access-control.test.ts
#	internal/cloud/server-agent-chat.test.ts
2026-06-02 12:13:50 +08:00
Codex 3497a8993b feat: support agentrun steer and idle continuation 2026-06-02 10:29:46 +08:00
Codex 48492ba267 fix: 释放孤儿 active trace 2026-06-02 08:55:10 +08:00
Codex 666395f056 fix: ignore stale workbench active trace 2026-06-02 08:35:12 +08:00
Codex da96f02333 fix: preserve AgentRun reuse mapping and trace rendering 2026-06-02 03:16:50 +08:00
Codex 66ffd2e171 fix: repair stale terminal workbench conversations 2026-06-02 02:45:00 +08:00
Codex bf2bdee5f6 fix: sync terminal workbench conversation 2026-06-02 02:25:29 +08:00
Codex 577622d0ab fix: sync terminal workbench traces 2026-06-02 01:55:19 +08:00
Codex 90f030e8f7 fix: release completed agentrun workspace turns 2026-06-02 00:50:20 +08:00
Codex 99aeb99991 fix(workbench): bind postgres workspace created timestamp 2026-06-01 22:00:16 +08:00
Codex 4691780b7a fix(workbench): type postgres workspace update role parameter 2026-06-01 21:54:02 +08:00
Codex b7285b30b1 feat(workbench): share account workspace across web and cli 2026-06-01 21:31:26 +08:00
Codex 3d10fd275b feat: 接入 AgentRun v0.1 adapter 2026-06-01 17:06:11 +08:00
Codex 25a469762b fix: grant code agent device pod access 2026-05-31 17:01:23 +08:00
Codex 945c2ba3d0 fix: persist user code agent sessions 2026-05-31 16:00:05 +08:00
Codex aee03fab68 fix: delegate cloud web auth to cloud api 2026-05-30 10:23:59 +08:00
Codex fb46d6c267 fix: enforce device pod profile identity 2026-05-29 20:31:30 +08:00
Codex be50c2fde4 fix: normalize empty device job blockers 2026-05-29 20:18:09 +08:00
Codex 99102f921b fix: create device lease holder session first 2026-05-29 19:59:29 +08:00
Codex 83840d43c8 fix: distinguish forbidden device pod access 2026-05-29 19:40:18 +08:00
Codex 8f0bda969b fix: align device pod status contract 2026-05-29 19:13:06 +08:00
Codex 221e36ec4a fix: persist rejected device pod jobs 2026-05-29 18:54:53 +08:00
Codex 8d5bbaa937 fix: return device pod context for mutating rejects 2026-05-29 18:16:47 +08:00
Codex 752fe382ab fix: reject secrets in device pod profiles 2026-05-29 17:28:47 +08:00
Codex 4c05009821 fix: require device pod executor for user jobs 2026-05-29 17:08:27 +08:00
Codex 5ebadee19f fix: require internal token for device pod executor 2026-05-29 16:28:34 +08:00
Codex 2fe1c89686 fix: allow v02 gateway protocol environment 2026-05-29 15:40:20 +08:00
Codex 4e7d837123 feat: seed device pods during v02 setup 2026-05-29 14:17:44 +08:00
Codex db9b5de68f feat: add v02 first admin setup 2026-05-29 13:54:01 +08:00
Codex 6367ea2e16 feat: route device pod probes through jobs 2026-05-29 12:31:38 +08:00
Codex bffbb00275 fix: bound device pod job output 2026-05-29 12:12:31 +08:00
Codex 4cdc80e672 feat: wire device pod gateway dispatch 2026-05-29 10:44:59 +08:00
Codex 062f4b2112 feat: route device pod jobs through executor 2026-05-29 10:03:57 +08:00
Codex 1eff0ec472 feat: enforce device pod leases 2026-05-29 09:36:41 +08:00
Codex b0aa3ecac7 fix: expose v02 access status routes 2026-05-29 08:54:23 +08:00
Codex 671303d2b9 feat: add v02 access device pod authority 2026-05-29 02:15:55 +08:00