deepseek-harness/docs/core-data-structures
Tianyi Cui c658f4d155 fix(hooks): address Codex review — tighten codec to the reference schemas, preserve stdout
Codex's PR-E review found three protocol-fidelity blockers + two doc gaps, all
verified against ~/repos/refs:

- (A) Top-level `decision` accepted allow/deny/ask, but both reference schemas
  reserve those for hookSpecificOutput.permissionDecision — the legacy top-level
  decision is approve/block ONLY. Split topLevelDecisionOf (approve/block) from
  permissionDecisionOf (allow/deny/ask), so an out-of-band {"decision":"deny"} is
  now invalid and ignored instead of becoming a real blocking decision.
- (A) hookSpecificOutput was parsed without its hookEventName discriminator.
  HookOutput now surfaces hookEventName so a bridge can discard a block whose
  claimed event doesn't match the firing one (the schemas key the block by event).
- (A) runHook discarded raw stdout. HookOutput now carries `stdout` (trimmed,
  verbatim) so a bridge can reproduce CC's plain-stdout rendering / Codex's
  plain-stdout-as-additionalContext behavior.
- (B) hook/* SessionEventMap variants were only named in prose; added a payload/role
  table to core-data-structures/session.md (a maintained catalog surface).
- (B) Removed PR-stack-position references (PR-F / "future bridge packages") from a
  test comment and the RFC, per the current-state-wording rule.

New codec tests: top-level allow/deny/ask invalid+ignored, hookEventName capture,
raw stdout preserved on plain + JSON + empty stdout. 51 tests, per-file 100%.
2026-07-01 01:12:04 +08:00
..
bash.md feat(bash): add stdin + extra env to the executor seam as a trusted-plugin surface 2026-06-30 13:52:25 +08:00
compaction.md refactor(compact): align compact/summary and CompactionResult on shadowed* naming 2026-06-23 16:51:20 +08:00
core.md fix(events): address Codex review — protect post-execute result, purge stale tools/execute refs 2026-06-30 20:25:30 +08:00
llm-streaming.md simplify(llm): drop unconsumed adapter-change event and assembled call surfaces 2026-06-21 01:27:41 +08:00
persistence.md Persist the seed boundary so fork-child replay routes correctly 2026-06-22 20:55:32 +08:00
session.md fix(hooks): address Codex review — tighten codec to the reference schemas, preserve stdout 2026-07-01 01:12:04 +08:00
subagent.md feat(subagent): enrich subagent/start + subagent/end lifecycle events (observe-only) 2026-06-30 21:29:08 +08:00
tools.md fix(events): address Codex review — protect post-execute result, purge stale tools/execute refs 2026-06-30 20:25:30 +08:00