Skip to content

[Loops] Loop Goal integration fixtures discard required task claim tokens #417

Closed

Description

@franciscpd

Summary

The shared daemon integration fixture for managed Goal sessions claims loop-bound task runs and then starts them without forwarding the returned claim token. Current task lifecycle validation correctly rejects those starts with task: invalid claim token, leaving five subtests in TestLoopGoalManagedRuntimeIntegration red on main.

This is a test-fixture ownership bug, not a request to relax runtime claim validation.

Reproduction

On current main:

mise exec -- go test -tags=integration ./internal/daemon \
  -run '^TestLoopGoalManagedRuntimeIntegration$'   -count=1 -v

Five managed-runtime cases fail while constructing the fixture, for example:

StartRun("taskrun-goal-managed-terminal") error =
store: transition task run starting transaction:
store: execute sqlite write callback:
task: invalid claim token

Root cause

seedDaemonTaskRunLifecycle calls ClaimNextRun for loop-bound workers, assigns only claim.Run to its local state, and discards claim.ClaimToken. It later calls manager.StartRun without that token.

Three other daemon E2E fixtures were updated to use their claim token, but the shared managed-Goal fixture still follows the stale path.

Expected behavior

The fixture must carry the exact token returned by the successful claim into the claimed-to-starting transition. Production validation must remain fail-closed for missing or incorrect tokens.

Acceptance criteria

  • seedDaemonTaskRunLifecycle (or its canonical replacement) forwards the exact claim token for loop-bound runs.
  • Direct daemon admission remains tokenless only where the existing contract permits it.
  • A regression test proves the helper cannot start a claimed run after dropping or replacing the token.
  • TestLoopGoalManagedRuntimeIntegration passes in full.
  • The three previously repaired daemon E2E scenarios remain green.
  • No production claim-token validation is weakened.

Activity

  1. changed the title [-]Loop Goal integration fixtures discard required task claim tokens[/-] [+][Loops] Loop Goal integration fixtures discard required task claim tokens[/+] on Aug 16, 2026
  2. moved this from Todo to In Progress in CompozyOS Devon Aug 16, 2026
  3. moved this from In Progress to Done in CompozyOS Devon Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions