Skip to content

Task: T11293 add --parent none escape hatch for depth-2 focused-session auto-parent trap - #1135

Open
kryptobaseddev wants to merge 1 commit into
mainfrom
task/T11293
Open

Task: T11293 add --parent none escape hatch for depth-2 focused-session auto-parent trap#1135
kryptobaseddev wants to merge 1 commit into
mainfrom
task/T11293

Conversation

@kryptobaseddev

@kryptobaseddev kryptobaseddev commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #1127: the depth-2 focused-session failure where cleo add auto-parents a new task to the current focus task (at max depth), causing E_CLEO_DEPTH_EXCEEDED with misleading remediation guidance.

Changes

--parent none sentinel (CLI + Core)

Both --parent and --parent-id accept "none" to suppress focus-task inference. The sentinel is forwarded to inferTaskAddParams but never dispatched as a literal parent ID.

Depth-cap error message fix

Removes misleading "omit --parent to create a standalone task" guidance. Under strict-spine containment (T11811) only sagas may be root-level, and the parent may have been auto-inferred from the session focus. Points to a concrete higher-level container or --parent none instead.

--field /data/created/0 + --quiet

Verified already working correctly via existing output-contracts tests and the mutate-minimal-envelope middleware. No changes needed.

Files changed (4)

  • packages/cleo/src/cli/commands/add.ts
  • packages/cleo/src/cli/commands/__tests__/add-parent-inference.test.ts
  • packages/core/src/tasks/add.ts
  • packages/core/src/tasks/infer-add-params.ts

Test Evidence (12/12 pass)

✓ --parent none suppresses inference and does NOT set parent on dispatch (T11293)
✓ --parent none forwards sentinel to inferTaskAddParams as parentRaw (T11293)
✓ --parent none does NOT log inference notice (T11293)
✓ --parent-id none suppresses inference like --parent none (T11293 alias)
✓ --parent-id none forwards sentinel to inferTaskAddParams (T11293 alias)
✓ depth cap error message names the grandparent epic as the suggested target
✓ reports a clear actionable message with suggested parent epic when depth cap is exceeded

Closes #1127

…on auto-parent trap

- Add --parent none sentinel to suppress session-based parent inference.
  Both --parent and --parent-id aliases accept "none"; neither dispatches
  the literal string as a parent ID.
- Forward sentinel to inferTaskAddParams so Core skips the focus-task
  heuristic when the user explicitly opts out.
- Fix depth-cap error message: never promise standalone task creation under
  strict-spine (T11811); point to a concrete higher-level container instead.
- 12 unit tests (all pass): 7 existing + 5 new covering --parent none,
  --parent-id none alias, sentinel forwarding, and inference suppression.

--field /data/created/0 + --quiet already verified correct by existing
output-contracts tests and the mutate-minimal-envelope middleware.

Closes #1127
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:cleo add forces the session-focus parent, then rejects its own default with a depth-cap error (and the suggested fix is false)

1 participant