Skip to content

#1035 Add lifecycle workspace with the canonical envelope, vocabulary & lane fold - #1049

Merged
williamthorsen merged 7 commits into
mainfrom
1035
Jul 19, 2026
Merged

#1035 Add lifecycle workspace with the canonical envelope, vocabulary & lane fold#1049
williamthorsen merged 7 commits into
mainfrom
1035

Conversation

@williamthorsen

@williamthorsen williamthorsen commented Jul 19, 2026

Copy link
Copy Markdown
Owner

What

Introduces @codeassembly/lifecycle, a shared workspace package that houses the canonical lifecycle-event envelope, the event vocabulary, and the fold that turns a lane's events into session and lane state. The package is dependency-free and browser-bundle-safe.

Why

The canonical event envelope and vocabulary lived only on the write side, and the only fold from events to lane state was throwaway spike code, so the planned lane and watching surfaces had no reusable foundation to build on. The repo's own history shows the cost of leaving a shared schema uncentralized: run-log-schema and event-folder each drifted into divergent duplicate copies across run-core and factory. Consolidating the envelope, vocabulary, and fold into one dependency-free, browser-safe package gives readers and writers a single source and forecloses that drift.

Details

🏗️ Internal features

  • @codeassembly/lifecycle defines the lifecycle-event envelope and the v0 event vocabulary once, for both writers (the emit helper, the hook relay) and readers (watching surfaces).
  • Tolerant readers: parseEventLine turns a JSONL line into an envelope, and parseLanePath turns an event-file path into lane and session identity — each returning null for malformed or foreign input rather than throwing, as befits append-only telemetry.
  • The pure lane fold derives session and lane state from a lane's events: working/waiting from turn boundaries, work narration from skill events, the pending ask a waiting session holds, session end and resume, and lane closure from a worktree probe, all sessions ending, or lane-wide staleness. Time and probe results arrive as inputs, so the derivation runs identically in a browser, a server, or a test.
  • Branch-name ticket attribution: a Jira-style key anywhere in the name, or a numeric prefix, each with an optional .N revisit suffix, yields a lane ticket ref; other names yield none. The pattern contract is defined once here.
  • The package carries no runtime dependencies, and its public surface is browser-bundle-safe.

♻️ Refactoring

  • The envelope and vocabulary move out of the agents emit-event module; the emit helper and hook relay now import them from @codeassembly/lifecycle.
  • The agents session-context ticket-id extractor now composes the branch-name pattern from the shared package, keeping only its configured ticket_ref_prefix formatting and PR-sentinel handling.

🧪 Tests

  • A browser-bundle test esbuild-bundles the public surface for the browser platform, so a stray Node-builtin import fails the unit suite rather than the first downstream web build.

Closes #1035

Adds `@codeassembly/lifecycle`, the workspace package that defines the canonical lifecycle-event envelope and vocabulary once for writers and readers alike; the emit helper and hook relay in the agents package now import that definition rather than carrying their own copy.
Readers of the event store can now parse JSONL lines into envelopes and event-file paths into lane and session identity through `@codeassembly/lifecycle`, with malformed or foreign input yielding null instead of an error.
Lanes whose branch names a ticket (`984`, or `984.2` for a revisit) now yield a ticket attribution; any other branch name yields none, leaving the lane to render without a ticket rollup.
Watching surfaces can now derive lane and session state from a lane's events: working/waiting status from turn boundaries, work narration from skill events, the pending ask a waiting session is waiting on, session end and resume, and lane closure from a worktree probe, all sessions ending, or lane-wide staleness. Time and probe results are inputs, so the fold runs identically in a browser, a server, and a test.
The no-Node-builtins contract on the package's public surface is now enforced by a test that bundles the surface for the browser, so a violation fails the unit suite instead of the first downstream web build.
Lanes now gain ticket attribution from any branch name that encodes a ticket id — a Jira-style key anywhere in the name or a numeric prefix, with the `.N` revisit suffix captured as an ordinal — instead of only bare `984`-form names, so description-suffixed and Jira-keyed branches roll up to their tickets before a PR exists.

The branch-name pattern contract is now defined once, in `@codeassembly/lifecycle`; session-context extraction in the agents package composes it with its prefix formatting and PR-sentinel handling, with behavior unchanged there.
Comments in the lifecycle package and ticket-id extraction now state contracts and constraints only; design-session narration, consumer name-dropping, and restatements of adjacent code are removed.
@williamthorsen williamthorsen added internal Internal change without external impact scope:agents scope:lifecycle labels Jul 19, 2026
@github-actions

Copy link
Copy Markdown

Dependency audit

Production dependency audit passed.

@williamthorsen williamthorsen changed the title #1035 Add @codeassembly/lifecycle with the canonical envelope, vocabulary, and lane fold #1035 Add lifecycle workspace with the canonical envelope, vocabulary & lane fold Jul 19, 2026
@williamthorsen williamthorsen self-assigned this Jul 19, 2026
@williamthorsen
williamthorsen marked this pull request as ready for review July 19, 2026 14:22
@williamthorsen
williamthorsen merged commit 0dd4d15 into main Jul 19, 2026
3 checks passed
@williamthorsen
williamthorsen deleted the 1035 branch July 19, 2026 14:42
williamthorsen added a commit that referenced this pull request Aug 4, 2026
…e-v0.2.2 codeassembly-v0.4.0 factory-v0.2.2 codeassembly-mcp-v0.2.2

codeassembly-v0.4.0
- #1153 feat: Make codeassembly and kb CLI tools publishable (#1164)
- #1091 fix: Anchor a project-deployed link where its target deploys (#1159)
- #1156 refactor: Rename packages to publishable names (#1157)
- #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155)
- #1110 tooling: Migrate Vitest to nmr's centralized model (#1154)
- refactor: Refine typescript-preferences
- #1150 fix: State doc-description form and make comment mood opt-in (#1151)
- deps: Upgrade first-party linting deps to latest version
- #1137 feat: Establish personal rulebooks for code layout and TypeScript preferences (#1144)
- #1126 feat: Check a package's own guidance content before it ships (#1138)
- refactor: Fix lint
- tooling: Remove redundant lint rules
- #1133 fix: Reject an anchor link that names no heading (#1135)
- #1122 feat: Capture lede decisions as an accumulating corpus (#1132)
- #1125 feat: Honor invocation tokens in rulebook bodies (#1129)
- #1107 feat: Render rulebook links and path tokens per harness (#1124)
- #1115 feat: Sync guidance at build and install so an upgrade cannot leave it stale (#1123)
- #1114 feat: Adopt a dependency's guidance by naming the package (#1121)
- #1088 feat: Deliver project ambient rulebooks per harness (#1113)
- #1087 refactor: Rename the authoring rulebook and mark its enforced rules (#1092)
- #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102)
- #1094 refactor: Remove the ambient ripgrep dependency from the test suite (#1097)
- deps: Upgrade all deps to latest version
- tooling: Upgrade all deps to latest version & modernize configs
- refactor: Fix lint
- #1077 feat: Show the proposed edit above post-review menu options (#1078)
- #1068 feat: Deliver ambient rulebooks mechanically, retiring GLOBAL.md (#1075)
- #1069 feat: Add a no-second-person rule to the lede-voice doctrine (#1070)
- #1050 feat: Add a redundancy rule to the lede-voice doctrine (#1058)
- #1035 internal: Add lifecycle workspace with the canonical envelope, vocabulary & lane fold (#1049)
- #1006 internal: Extend lifecycle-event instrumentation to five high-traffic skills (#1034)
- #1028 feat: Rule out absence-of-removed-code tests (#1032)
- #114 feat: Let reviewers emit gated insights into review artifacts (#1031)
- #1027 internal: Retire input.received and redundant skill.progress emits (#1030)
- #1026 fix: Name the side effects an approval ask authorizes (#1029)
- #1022 fix: Normalize action and question label identifiers across asks blocks (#1025)

factory-v0.2.2
- #1156 refactor: Rename packages to publishable names (#1157)
- deps: Upgrade all deps to latest version
- #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155)
- #1110 tooling: Migrate Vitest to nmr's centralized model (#1154)
- tooling: Remove redundant lint rules
- deps: Upgrade deps to latest version
- deps: Upgrade all deps to latest version
- deps: Upgrade all deps to latest version
- tooling: Upgrade all deps to latest version & modernize configs
- refactor: Fix lint
- deps: Upgrade all deps to latest version

kb-v0.3.0
- #1153 feat: Make codeassembly and kb CLI tools publishable (#1164)
- #1156 refactor: Rename packages to publishable names (#1157)
- #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155)
- #1110 tooling: Migrate Vitest to nmr's centralized model (#1154)
- tooling: Remove redundant lint rules
- #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102)
- tooling: Upgrade all deps to latest version & modernize configs
- refactor: Fix lint

codeassembly-lifecycle-v0.2.0
- #1153 feat: Make codeassembly and kb CLI tools publishable (#1164)
- #1156 refactor: Rename packages to publishable names (#1157)
- #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155)
- #1110 tooling: Migrate Vitest to nmr's centralized model (#1154)
- tooling: Remove redundant lint rules
- #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102)
- tooling: Upgrade all deps to latest version & modernize configs
- #1038 feat: Add the read-only git adapter for worktree and base-branch ground truth (#1059)
- #1051 feat: Bound fold memory and rescan cost with a retention window (#1057)
- #1035 internal: Add lifecycle workspace with the canonical envelope, vocabulary & lane fold (#1049)

codeassembly-mcp-v0.2.2
- deps: Upgrade all deps to latest version
- #1156 refactor: Rename packages to publishable names (#1157)
- #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155)
- #1110 tooling: Migrate Vitest to nmr's centralized model (#1154)
- #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102)
- tooling: Upgrade all deps to latest version & modernize configs
- refactor: Fix lint

codeassembly-run-core-v0.2.2
- #1156 refactor: Rename packages to publishable names (#1157)
- #1152 tooling: Run every test in the default gate, classified by what it reaches (#1155)
- #1110 tooling: Migrate Vitest to nmr's centralized model (#1154)
- #1095 tooling: Move compilation out of the install lifecycle into a bootstrap step (#1102)
- tooling: Upgrade all deps to latest version & modernize configs
- refactor: Fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Internal change without external impact scope:agents scope:lifecycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add @codeassembly/lifecycle with the canonical envelope, vocabulary, and lane fold

1 participant