Skip to content

feat: redesign orbit context around purpose — startup / cruise blocks - #17

Merged
zheng-weihao merged 1 commit into
mainfrom
feat/context-system-refactor
Jul 21, 2026
Merged

zheng-weihao merged 1 commit into
mainfrom
feat/context-system-refactor

Conversation

@zheng-weihao

Copy link
Copy Markdown
Member

Summary

Redesigns orbit context as a purpose-scoped command family and moves every piece of hook logic into the CLI, so agents see a single consistent context channel across Claude, Codex, Qoder, and OpenCode.

  • Three purpose-scoped entries instead of flag stacking: --startup (session-start block, routes internally to prime/reignite), bare orbit context (cruise block — in-session recovery), <key> (single value).
  • Cruise block = cheap durables + conditional per-repo status (jot count / behind upstream / memo state) — never dumps memos, never fetches. Token discipline: mid-session refreshes never re-inject full memos.
  • Hooks are thin wrappers — session-start.sh / session-resume.sh only run one orbit context command and wrap its markdown in <orbit-context> tags. All cold/resume detection logic moved into orbit.sh (bats-testable). stop.sh removed; its nudges are covered by add-time stderr + cruise block + done gate.
  • [seed] jot sentinel and the gap model retired — replaced by inline computation on every read (add-time stderr, per-repo status, done gate), no durable placeholders.
  • Done gate is per-repo with merged lines: leftover jots / thin memo with no capture / over-budget card. Advisory, but the skill now teaches the agent to treat actionable orbit: stderr as procedure requirements, not suggestions.
  • OpenCode plugin: first transform injects --startup; cache rebuilds use the cruise block (never re-inject full memos); session.compacted injects two-way (immediate prompt + cache update). Resume routing is blocked on anomalyco/opencode#5409 (SessionStart hook with startup/resume/compact sources); the skill is the documented fallback.
  • docs/spec-hooks.md is the new single home for the hook behavior contract (injection tiers, <orbit-context> tags, event routing matrix, auto-approve semantics).
  • P8 refined: stdout carries machine-facing data by default, model-facing context for the orbit context family — session injection forwards them into model context.
  • Skill: actionable orbit: stderr is a procedure requirement; explore is conditional on session-accumulated context; config key names (explore.paths, jot.bufferSize, memo.maxLines) no longer leak into agent-facing docs.

Test plan

  • make test — 203/203 green
  • bash -n orbit.sh hooks/*.sh hooks/codex/*.sh syntax OK
  • node --experimental-strip-types --check .opencode-plugin/plugin.ts syntax OK
  • Workspace A/B/C/D live verification: prime/reignite/cruise blocks, done gate per-repo, jot three-band, add stderr explore.paths, two-layer staleness, <orbit-context> tag wrapping, non-workspace silent no-op
  • OpenCode live verification: startup block injected on fresh session; resume fires no event (matches #5409); session.compacted re-injects cruise block

Notes

  • orbit context status → state (single key); orbit status command unchanged.
  • context gaps key retired; per-repo status is the replacement.
  • --prime / --reignite remain as explicit routing targets for humans/debugging; the skill exposes only --startup and bare.

@zheng-weihao
zheng-weihao force-pushed the feat/context-system-refactor branch from cd6b70c to 121deb6 Compare July 21, 2026 12:21
- purpose-scoped entries: --startup (session start, routes prime/reignite) /
  bare (cruise block, in-session recovery) / <key> (single value)
- cruise block: cheap durables + conditional per-repo status (no memos, no fetch)
- done gate per-repo; bufferSize (memo.minLines) replaces hardcoded jot threshold
- add-time stderr carries explore scope; [seed] jot sentinel + gap model retired
- hooks are thin wrappers over orbit context; stop.sh removed
- opencode plugin: transform injects --startup; cache rebuilds use cruise block;
  session.compacted two-way injection; resume TODO blocked on anomalyco/opencode#5409
- spec-hooks.md is the hook behavior contract
- P8: stdout carries machine-facing data by default, model-facing context for
  orbit context family
- skill: actionable orbit stderr = procedure requirement; explore is conditional
  on session-accumulated context; config key names no longer leak into agent docs

Signed-off-by: zheng-weihao <zheng-weihao@outlook.com>
@zheng-weihao
zheng-weihao force-pushed the feat/context-system-refactor branch from 121deb6 to e4df461 Compare July 21, 2026 12:43
@zheng-weihao
zheng-weihao merged commit 64afe4e into main Jul 21, 2026
3 of 6 checks passed
@zheng-weihao
zheng-weihao deleted the feat/context-system-refactor branch July 23, 2026 00:49
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.

1 participant