Skip to content

chore(sessions): don't compose lifecycle hooks until we finish implementing them - #975

Merged
norrietaylor merged 1 commit into
mainfrom
evan/removelifecyclehooks
Jul 27, 2026
Merged

chore(sessions): don't compose lifecycle hooks until we finish implementing them#975
norrietaylor merged 1 commit into
mainfrom
evan/removelifecyclehooks

Conversation

@evanspearman

@evanspearman evanspearman commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

Lifecycle hooks won't be ready for open source launch, so for now we won't compose them in and won't print any output about them.

Testing

Activated a session with a loadout that had a lifecycle hook defined and verified that there were no log messages about it

Note

Gate lifecycle hooks out of session composition before full implementation

  • Adds Loadout::without_lifecycle_hooks in loadout.rs to strip lifecycle hooks from a loadout, used as a feature gate until hooks are fully implemented.
  • compose_user_contribution in loadouts.rs now drops lifecycle hooks from user loadouts before building the UserComposer, so no hooks appear in the resulting WireContribution.
  • Removes lifecycle hook count from the loadout listing display and from compose-time tracing logs in session_host.rs and composer.rs.
  • Behavioral Change: lifecycle hooks declared in user loadouts are silently excluded from composed sessions until this gating is removed.

Macroscope summarized 26cd1d2.

Summary by CodeRabbit

  • Bug Fixes
    • Lifecycle hooks declared in sessions and loadouts are no longer included in composed contributions.
    • Session content logging no longer reports lifecycle-hook details, and daemon lifecycle hook counts are no longer logged.
    • Loadout listings now show package/variable/patch counts only.
  • New Features
    • Added a Loadout helper to remove lifecycle hooks before composing.
  • Configuration
    • Updated the example project upstream tracking to unstable with a new locked revision.
  • Tests
    • Added coverage ensuring hook-containing loadouts are excluded from the resulting wire contribution.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Lifecycle hooks are cleared from minimal loadout contributions, excluded from related counts and runtime logging, and covered by a composition test. Documentation clarifies downstream gating, while the example upstream configuration moves to a new branch and commit.

Changes

Lifecycle hook suppression

Layer / File(s) Summary
Composition suppression
crates/sessions/src/core/loadout.rs, crates/minimal/src/loadouts.rs, crates/mfile/src/project_composable.rs
Loadouts gain hook removal before composition; counts and tests reflect the resulting hookless contribution, while project documentation describes downstream gating.
Runtime observability suppression
crates/minimald/src/session_host.rs, crates/sessions/src/daemon/composer.rs
Session content logging and daemon composition logs no longer report lifecycle hooks.

Example upstream fixture update

Layer / File(s) Summary
Example upstream pin
crates/sessions/example_project/minimal.toml
The example upstream tracks unstable at a new locked commit.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: twitchyliquid64

Poem

A rabbit hops where hooks once ran,
Empty wires cross the span.
Counts grow neat, logs softly sleep,
Unstable pins their promise keep.
Fluffy paws approve the change!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, conventional commit-style, and accurately summarizes gating lifecycle hooks out of session composition.
Description check ✅ Passed Includes a clear Summary and Testing section with concrete verification; only the checklist section from the template is missing.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/minimal/src/loadouts.rs`:
- Around line 106-113: Update the loadout preparation flow before
UserComposer.compose (and its underlying add_all) so lifecycle hooks are removed
or excluded before composition, rather than clearing wire.lifecycle_hooks
afterward. Ensure invalid or duplicate hooks cannot trigger validation or
conflicts, and add coverage confirming they do not affect an otherwise valid
loadout.

In `@crates/minimald/src/session_host.rs`:
- Around line 244-247: Update the comment near the disabled session transition
script logic to state that declared project hooks are accepted and composed but
currently suppressed or omitted from emitted output, rather than refused at
compose time. Preserve the note that the content-logging loop should be restored
when the feature ships.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb8909ae-df5c-4cd7-8956-05fd8854f12e

📥 Commits

Reviewing files that changed from the base of the PR and between 09660c9 and ae34bff.

📒 Files selected for processing (5)
  • crates/mfile/src/project_composable.rs
  • crates/minimal/src/loadouts.rs
  • crates/minimald/src/session_host.rs
  • crates/sessions/example_project/minimal.toml
  • crates/sessions/src/daemon/composer.rs
💤 Files with no reviewable changes (1)
  • crates/sessions/src/daemon/composer.rs

Comment thread crates/minimal/src/loadouts.rs Outdated
Comment thread crates/minimald/src/session_host.rs Outdated
@evanspearman
evanspearman force-pushed the evan/removelifecyclehooks branch from ae34bff to 26cd1d2 Compare July 27, 2026 17:42
@norrietaylor
norrietaylor merged commit 02a1deb into main Jul 27, 2026
29 checks passed
@norrietaylor
norrietaylor deleted the evan/removelifecyclehooks branch July 27, 2026 18:17
norrietaylor added a commit that referenced this pull request Jul 27, 2026
- mention detach in the intro
- introduce loadouts in 'Why sessions' as the personal-tooling vector
- note loadouts contribute to the shell, never to tasks
- make session-vs-sandbox terminology consistent (session = durable
  environment; sandbox = execution context)
- describe current networking caveats: own-ip unavailable on the native
  Linux provider, macOS host-net outbound-only
- correct the lifecycle-hooks status after #975: project hooks composed
  but never executed, loadout hooks excluded from composition
- platform-neutral wording for min stop

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
norrietaylor added a commit that referenced this pull request Jul 27, 2026
Per review: flag the feature up front instead of the stale trailing
note. After #975 loadout-declared hooks are excluded from composition
entirely, so the old 'composed and recorded' wording was wrong too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
norrietaylor added a commit that referenced this pull request Jul 27, 2026
* docs(concepts): add the loadouts concept guide

* docs(sessions): de-emphasize mip in loadouts session boundary

Loadouts are a session-plane feature, and tasks run through both
`min run` and `mip run`, so naming only `mip` as the task runner
over-attributed task execution to the advanced build CLI. Drop the
`mip` naming and keep the accurate loadouts-apply-to-sessions-not-
task-sandboxes contrast.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(concepts): loadout accuracy fixes from agent-test review

Note that hook execution is not yet wired up, state that conflicting values
fail activation, show the default-loadout legend line in the ls sample, and
use bare home-relative patch dests to match the reference schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(concepts): mark loadout lifecycle hooks as coming soon

Per review: flag the feature up front instead of the stale trailing
note. After #975 loadout-declared hooks are excluded from composition
entirely, so the old 'composed and recorded' wording was wrong too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
norrietaylor added a commit that referenced this pull request Jul 27, 2026
* docs(concepts): add the sessions concept guide

Author a user-facing concept guide for Minimal sessions: what a session
is and why, the provider/session model, creating and entering one,
composition from project config plus loadouts, lifecycle, and how
sessions relate to sandboxes and tasks. Grounded in the min CLI surface
and the architecture docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(concepts): correct session exec, sync, and lifecycle semantics

The command channel accepts only min run invocations, project files are an
uploaded workspace copy (git push min:// brings changes back), lifecycle hook
execution is not yet wired, provider stop keeps session records, and the
sandbox persists across detach. Also covers detach explicitly and drops the
redundant trailing path from the activate example, per review.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(concepts): address review on the sessions guide

- mention detach in the intro
- introduce loadouts in 'Why sessions' as the personal-tooling vector
- note loadouts contribute to the shell, never to tasks
- make session-vs-sandbox terminology consistent (session = durable
  environment; sandbox = execution context)
- describe current networking caveats: own-ip unavailable on the native
  Linux provider, macOS host-net outbound-only
- correct the lifecycle-hooks status after #975: project hooks composed
  but never executed, loadout hooks excluded from composition
- platform-neutral wording for min stop

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

3 participants