hive
· Natural-language workflow creator
Review
reviews/codex-ce-code-review-02.md
High
- [x] AUTO-FIX: Read-only CLI routes mutate scheduler state before dispatch (
bin/hive:12): workflow validate and init --preview can repair units, write reconciliation state, and restart timers before their no-write command bodies run. <!-- triage: plan U3 and U4 require strict no-write routes -->
- [x] AUTO-FIX: Human approval follows agent-controlled artifact symlinks (
lib/hive/commands/decide.rb:200): a preceding agent can point draft.md outside the task and have external bytes certified as the publish-ready artifact. <!-- triage: plan R6 requires a task-local publish-ready artifact -->
- [x] AUTO-FIX: Minimal init installs a timer that its preview declares disabled (
lib/hive/commands/init.rb:795): production execution calls install_runtime_hooks!, which unconditionally installs the scheduler while tests mask it with the global skip flag. <!-- triage: plan U4 explicitly disables minimal-profile timers -->
- [x] AUTO-FIX: Failed creation cleanup leaves phantom state staged (
lib/hive/commands/new.rb:206): commit failure deletes only working-tree files after hive_commit stages them, so a later state commit can persist the failed task or workflow. <!-- triage: clear state-index rollback defect -->
- [x] AUTO-FIX: Owner-authored workflow content is omitted from the idempotency fingerprint (
lib/hive/commands/new.rb:300): descriptor and instruction changes under the same ID silently reuse the old task instead of rejecting a different workflow. <!-- triage: plan U5 requires different workflow input to conflict -->
- [x] AUTO-FIX: Corrupt task metadata makes idempotency fail open (
lib/hive/commands/new.rb:310): TaskMeta.read converts unreadable or malformed metadata to an empty record, hiding the original key and permitting a duplicate task. <!-- triage: plan R9 requires at-most-one task across retries -->
- [x] RESOLVED/NO-FIX: Human fields expand closed JSON contracts without versioning (
lib/hive/commands/status.rb:1360): status v6, operational-status v1, and run v2 add fields or enum values under unchanged closed schemas, breaking existing strict consumers. <!-- triage: plan U2 and ADR-025 explicitly keep same-version required closed additions -->
- [x] AUTO-FIX: Workflow collision checks follow dangling descriptor symlinks (
lib/hive/commands/workflow.rb:269): File.exist? misses the symlink and the subsequent scaffold write can create a target outside the workflows directory. <!-- triage: plan R2 requires collision refusal before mutation -->
- [x] AUTO-FIX: Minimal init writes through pre-existing project symlinks (
lib/hive/llm_wiki_bootstrap.rb:234): clean tracked or ignored managed-path symlinks can redirect bootstrap writes outside the project without containment or no-follow checks. <!-- triage: plan R4 requires preserving existing project choices -->
- [x] AUTO-FIX: Generated task commands do not safely quote the original request (
skills/hive/references/workflow-creator.md:88): embedded quotes or shell substitutions can alter or execute the promised copy-and-paste command. <!-- triage: plan R8 requires an exact safe next command -->
- [x] AUTO-FIX: Retry key derivation is not deterministic across fresh agents (
skills/hive/references/workflow-creator.md:91): no canonical normalization or derivation algorithm is defined, so equivalent retries can use different keys and create duplicate tasks. <!-- triage: plan R9 requires stable retry identity -->
- [x] AUTO-FIX: Creator acceptance bypasses refusal gates and the populated-graph commit (
test/integration/workflow_creator_e2e_test.rb:203): the helper manually invokes commands and edits YAML, never exercising old-version/unconfirmed-init refusals or proving the required durable commit. <!-- triage: plan U8 requires hermetic refusal and commit evidence -->
Medium
- [x] AUTO-FIX: Self-targeting human outcomes report false success (
lib/hive/commands/decide.rb:227): Approve takes its same-stage no-op before the observation guard, but Decide still reports applied: true without recording or resetting the decision. <!-- triage: plan U2 requires every outcome to record or no-op truthfully -->
- [x] AUTO-FIX: Concurrent identical decisions return a false stale error (
lib/hive/commands/decide.rb:243): both calls can pass the pre-lock check, after which the loser sees the winner's marker and raises instead of returning the required idempotent no-op. <!-- triage: plan U2 explicitly requires same-decision idempotency -->
- [x] AUTO-FIX: Idempotent task creation inverts managed-workflow lock order (
lib/hive/commands/new.rb:193): creation takes commit then mutation lock while workflow activation takes mutation then commit lock, forming a timeout-producing lock cycle. <!-- triage: clear lock-order cycle with one canonical ordering -->
- [x] AUTO-FIX: Post-ownership
EEXIST leaves an orphan task candidate (lib/hive/commands/new.rb:259): the broad collision rescue also catches failures after Dir.mkdir, bypassing owned-directory cleanup and wedging retries. <!-- triage: clear owned-candidate cleanup defect -->
- [x] AUTO-FIX: Creator commits bypass the Hive state commit lock (
skills/hive/references/workflow-creator.md:74): raw git add and git commit can interleave with daemon or task writers and cross-contaminate state commits. <!-- triage: existing Hive state writes require the commit lock -->
Nit
← Back to task