Skip to content

test(sdd): cover same-id untracked settle recovery #4219

Description

@decode2

Pre-flight Checklist

  • I have searched existing issues and this is not a duplicate
  • I understand that PRs will be rejected if the linked issue does not have status:approved

📝 Bug Description

Current main can recover a compact settlement after the eligible-untracked inventory changes, but the managed guidance and benchmark corpus do not directly lock the executable recovery path.

The recovery that currently works is: receive the fresh digest from the stale-settlement refusal, retain the existing intended-untracked selection, and retry compact sdd-attempt settle with the same settle request ID. Some managed guidance still points callers toward Review STATUS or describes settle as having no recovery flags, and the existing j4040 journey does not directly prove same-ID settlement with a non-empty retained floor.

This issue requests test and guidance coverage only. It does not request a new production recovery object, a compact JSON schema change, or any runtime behavior change.

🔄 Steps to Reproduce

  1. On current main, acquire an SDD attempt with one selected eligible-untracked path.
  2. Create another eligible-untracked path while the attempt is active.
  3. Run compact sdd-attempt settle with the original inventory digest and a fixed settle request ID.
  4. Observe blocked(undeclared_untracked) and the current inventory digest in the refusal.
  5. Retry compact sdd-attempt settle with the same settle request ID, the returned digest, and the original path retained in the selection.
  6. Observe that settlement completes successfully.
  7. Inspect the managed SDD guidance and j4040 benchmark path; the successful same-settle-ID flow with a non-empty retained floor is not pinned end to end.

✅ Expected Behavior

The shipped guidance and benchmark coverage should match the already-working runtime behavior:

  • Name compact sdd-attempt settle as the recovery operation.
  • Require the same settle request ID for the retry.
  • Use the fresh eligible-untracked digest returned by the refusal.
  • Preserve the non-empty retained intended-untracked selection as the selection floor.
  • Do not route this SDD settlement recovery through Review STATUS.
  • Add driven benchmark evidence for the complete flow.

No production runtime or compact response schema should change.

❌ Actual Behavior

The runtime recovery succeeds, but the managed guidance and benchmark corpus do not directly enforce the exact executable continuation. This leaves room for future instructions or journeys to route callers through the wrong subsystem even while unit-level behavior remains correct.

Gentle AI Version

Current main at 4a628900a6fa0990b2060ddc5cbbd33a5e6d550e.

Operating System

Linux (Ubuntu/Debian)

AI Agent / Client

Other

📋 Affected Area

CLI (commands, flags)

💡 Logs / Error Output

STALE_SETTLE_STATE=blocked
STALE_SETTLE_REASON=undeclared_untracked
DIGEST_CHANGED=true
SAME_SETTLE_ID=audit-settle
SAME_ID_RETRY_STATE=complete
FINAL_RETAINED_SELECTION=selected.txt

Additional Context

A detached current-main reproduction completed the same-ID retry without invoking Review STATUS. PR #4167 was correctly closed because its production enhancement was unnecessary for the original #4090 symptom; this issue deliberately retains only the smaller test/guidance follow-up invited in the maintainer's closure comment.

Acceptance criteria:

  • Add or adapt one benchmark journey that drives stale compact settle refusal through successful same-ID retry with a non-empty retained selection.
  • Correct only the managed guidance needed to name that executable settle continuation.
  • Add focused contract coverage that fails if guidance regresses to acquire or Review STATUS routing.
  • Run both corpus validation and the driven benchmark harness against a locally built product binary, reporting completed/unsupported/failed counts.
  • Keep production Go behavior and compact JSON response types unchanged.

Non-goals:

Related evidence: #4040, #4066, #4090, and the closure comment on #4167.

This report was prepared with AI assistance from current-main source inspection, GitHub duplicate search, focused Go tests, and an isolated CLI reproduction. The user reviewed and confirmed the required pre-flight declarations.

Activity

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

    bugSomething isn't workingpriority:lowLow prioritystatus:approvedApproved for implementation — PRs can now be openedtype:bugBug fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions