Skip to content

modules: add an explicit-input jobs lifecycle command for scheduled, rebooked, cancelled, offer and closed events #1579

Open

Description

@schlessera

Context

Part of #838. It follows the conditional go in #845 (PR #1577, squash 5533a8d7, docs/decisions/opportunity-lifecycle.md). On held-out runs, explicit-input deterministic updates driven by Jev event/opportunity mapping were exact on 81/90, against 66/90 for the shipped interview-scheduled and related skills (packages/module-jobs/skills/), with no destructive vetoes in any arm. Cancellations were the weak case (3/9 against 6/9). The evidence is formative: the updater and the scorer (evals/845-opportunity-lifecycle/update.ts, score.ts) were refined against the same held-out set. The conditional go covers an explicit-input writer, not unconstrained message interpretation, and does not establish production path, concurrency or arbitrary Markdown safety.

The brain jobs dispatcher has no lifecycle subcommand today (packages/module-jobs/src/cli.ts:740-768). #1587 is the follow-up that delegates the interview-scheduled skill to this command once it lands; it consumes this command's documented input and refusal contract.

Scope

One explicit-input brain jobs lifecycle subcommand owning five transitions: scheduled, rebooked, cancelled, offer and closed.

  • Input: a validated event, a unique existing opportunity and the confirmed facts that transition requires. It drives the status, timeline, contact, prep-deadline, focus and pipeline updates, and those projections agree with the same confirmed event.
  • Paths resolve through the validated jobs taxonomy and module configuration (custom opportunity/pipeline directories included); writes use the product's normal safe-path and unchanged-source helpers. Re-read consulted sources and config before commit. Markdown stays authoritative; no new generic repair seam.
  • Refuse before any write: missing booking facts or rounds, unknown or ambiguous targets or current focus, contradictory timezone/clock facts, malformed eligible structures and unsafe paths. Prefer explicit refusal over inventing a current focus.
  • Cancellation keeps its reason, prior calls and timeline; authored prep prose is retained.
  • Preview (dry-run) and apply. Dry-run changes nothing; repeat application has no content or timestamp churn; stale source/target facts refuse visibly; unrelated files and metadata stay untouched. Describe partial-failure/compensation behaviour, with proof, before claiming multi-file effects safe.
  • Jev's two Choice questions (event, opportunity) are an optional, opt-in mapping step that returns none/unclear rather than guessed facts and never mints write authority.

Out of scope

Acceptance criteria

  • Keyless product tests cover all five transitions (scheduled, rebooked, cancelled, offer, closed), custom opportunity/pipeline directories, exact retained prose and history, and no wrong-target write.
  • Each refusal case listed in Scope is tested and leaves every file unchanged.
  • Cancellation keeps its reason, and an ambiguous current focus is refused before any write.
  • Dry-run writes nothing; a repeated apply is a byte-for-byte no-op; a stale input refuses.
  • A fresh validation set, unseen by modules: evaluate deterministic opportunity lifecycle updates #845's formative updater/scorer development, confirms the command against the shipped skills under Epic: use classification and deterministic code where generic prompting is wasteful #838's lean protocol and its existing model and spending bounds. Ordinary CI never needs a key.

Verification

  • bun run test packages/module-jobs plus the focused core integration tests the command touches; brain module lint if module metadata changes; tsc --noEmit; bun run lint.
  • Named guard mutations (drop the ambiguous-focus refusal; drop the cancellation-reason retention; let dry-run write) each fail their intended assertion before restoration; record both in the PR.
  • The fresh validation run's results file and decision note are attached to the PR, reviewed by a model from a different family than the author.
  • bun run check:pr --base origin/main and the selected hosted proof.

Contract impact

Additive: a new brain jobs subcommand and its --json envelope. Document the command, its input and refusal semantics in docs/integration-contract/cli.md (and the index in docs/integration-contract.md) in the same CONTRACT: commit, label the PR contract, and ship a minor changeset for @schlessera/brain-module-jobs. Update supported exports only if they actually change. Existing envelopes stay stable.

2026-10-24: consolidated the original brief and the 2026-10-11 implementation brief into one specification; the transition set is now five everywhere (offer was missing from the title and the original criteria); separated Verification from Contract impact.

Activity

  1. added
    type: feat
    area: modules
    priority: p2
    on Oct 11, 2026
  2. added
    agent-ready
    on Oct 11, 2026
  3. added
    contract
    on Oct 23, 2026
  4. schlessera commented on Oct 23, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 restructuring: added contract. The selected work changes a supported surface: an ordinary TypeScript export, a CLI command, an environment setting, a route or a contract type (docs/integration-contract.md). The body's Contract impact section is being corrected to match.

  5. changed the title [-]modules: add an explicit-input jobs lifecycle command for scheduled, rebooked, cancelled and closed events[/-] [+]modules: add an explicit-input jobs lifecycle command for scheduled, rebooked, cancelled, offer and closed events[/+] on Oct 24, 2026
  6. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24: folded the 2026-10-11 implementation brief and the "Sequencing, verification and contract" section into one current specification. Nothing was dropped: the five transitions (offer included), the refusal list, dry-run/no-op/stale-input rules, opt-in Jev mapping, fresh validation and the #1587 sequencing are all in the body. The title now names offer, matching the brief. The 2026-10-11 triage note (feat/modules/p2, native #838 parent, agent-ready) still holds.

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

    agent-readyarea: modulescontractpriority: p2type: feat

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions