Pulse Agent System and Gate Predicates

Pulse Agent System and Gate Predicates (draft for ~/code/spiced)

Draft 2026-07-11, from the Pulse session. Implements the five locked decisions: conformance tiers (D1), WF2 play map canonical (D2), hybrid agent topology (D3), pipeline-intelligence separation with a named merge gate (D4), deep-history dogfood scope (D5). Destination: split into spec/agents.md, spec/gates.md, spec/conformance.md, spec/derivations.md in justdansmith/spiced by whichever session lands it.

1. The handoff pattern (uniform, everywhere)

An agent team never hands work forward through prose. A handoff is:

  1. The producing team writes evidence events to the ledger (Level 2) or updates the SPICED record (Level 1).
  2. The gate predicate for the next team evaluates against the record. Predicates are pure functions of schema fields, versioned in the spec.
  3. On pass, a handoff event is appended to the ledger: {from_team, to_team, gate_id, gate_version, record_hash, ts}. The receiving team reads the record and opens its play window.
  4. On fail, the record stays with the producing team and the gap is named by the failing clause, which is itself the coaching signal.

Human ownership moves with the same gates (MD to PM to AM in WF4), so the agent handoff and the human handoff are the same event with two audiences.

2. Core record agents (shared services, the only writers of scores)

deal-health-agent (Diagnose owner)

coaching-agent (Technique owner)

Both agents are the only components that score anything. A scoring bug fixes in one place. Workflow teams below never score.

3. Workflow agent teams (thin consumers and producers)

Team Consumes Produces (via ledger events) Exit gate (hands to)
WF1 qualification Lead-channel feeds (3 channels, one adapter each), enrichment situation and pain seed evidence, ICP fit assessment G1 (to WF2): meeting booked AND ICP fit affirmed AND situation.captureIndex above floor
WF2 deal orchestration SPICED record, play map, coaching-agent outputs for the rep side Play-support artifacts: pre-call briefs, provoke assets, stakeholder map, MAP draft, proposal inputs G2 (to WF3): decision criteria attested AND CE verified AND proposal accepted (Trade entered)
WF3 quote-to-cash Deal record at Trade, pricing and legal doc set SOW and contract drafts (the existing SOW automation slots in here as first citizen), deal-desk gate checks, signature and invoice tracking events G3 (to WF4): paper signed AND kickoff scheduled
WF4 delivery and impact Record at kickoff, delivery telemetry impact.realized fields (firstValueDate, realizedValue, recurringImpactScore), renewalRisk signals, six stage-gate events with MD/PM/AM ownership moves G4 (to WF5): first value evidenced AND realized-impact review complete
WF5 expansion Realized impact, account structure Whitespace analysis, expansion candidates written back as WF1-grade leads with S and P pre-seeded from realized evidence G5 (loops to WF1/WF2): expansion hypothesis with named persona and impact basis

4. WF2 play map as gate predicates (D2: canonical stage model)

Stages per the GTM-AI deck: TARGET, ORCHESTRATE, DEVELOP, PROPOSE, TEAM, COMMIT, with GO DARK, REVIVAL, NO FIT, NO INTEREST, LOST as edges. Play numbering follows the deck. Predicates reference spiced.schema.json fields; attested(x) means at least one ledger evidence event supports x (Level 2) or the field is populated (Level 1, rendered unattested).

# Play Stage Letters Due when Exit predicate
1 Qualify Target S, P lead exists ICP fit affirmed; strategic relevance noted; likelihood-of-impact hypothesis recorded
2 Diagnose Orchestrate S, P, I, CE, D G1 passed every namespace has at least one attested event; impact.projected populated
3 Engage Orchestrate D play 2 in progress play called (Train / Consult / GI); two or more buyer personas identified (decision.rolesPresent length >= 2)
4 Provoke Develop P, I, CE pain attested, impact unquantified or urgency absent customer-voiced urgency evidence; criticalEvent.exists = true with candidate date
5 Decision Process Develop D multiple personas identified stakeholder map complete; decision.threadCount >= 2; path to consensus recorded
6 Align Stakeholders Team D, I play 5 exit stakeholder meeting held with decider present; CxO sponsorship statement obtained
7 Mutual Action Plan Team D, CE play 6 exit MAP with milestones, owners, dates; customer-confirmed
8 Decision Criteria Team D, I workshop held decision criteria enumerated and attributed to stakeholders
9 Propose Propose I, D plays 7 and 8 exit proposal presented, mapped to criteria and projected impact
10 Trade Commit D proposal presented commercial terms exchanged deliberately; concession log exists
11 Paper Commit D, CE trade converged agreements finalized; execution readiness confirmed
12 Kickoff Commit I paper signed onboarding launched against first-impact objectives; G3 handoff fired
E1 Go Dark any CE 14+ quiet days against stage norm revival play triggered or LOST recorded with reason
E2 Revival any CE, I dark deal, new signal re-qualification passes play 1 predicate

Dueness for the Technique lens reads straight from this table: a play is scorable for a rep only when its "due when" clause held at call time. HubSpot stage mapping lives in a companion table (hubspot-stage-map.md) per D2, and each client onboarding produces its own copy of that mapping.

5. Conformance tiers (D1)

6. Derivations skeleton (spec/derivations.md)

Each namespace index is a pure function of ledger events. The rules below are the derivation layer; they came out of the Pulse rolling-state work:

7. Council amendments (2026-07-11, five-member debate, three rounds)

Adopted by consensus:

  1. No orchestrator, no agent teams (Q4 resolved). deal-health-agent and coaching-agent stay single LOGICAL writers with internal per-deal sharding and serialized writes; failover is a supervisor process plus idempotent replay over the durable ledger, never a second writer. Above them sits an observer-as-derivation: a deterministic nightly code pass (never an LLM) that reads the ledger and writes its findings back AS ledger events, so its votes carry provenance and an out-of-band shadow channel never forms. Scope, absence-first: due-but-never-evaluated gates, ingest silence, unacknowledged handoffs ("the ledger cannot record its own silence"), plus contradiction-count trend and version-pin drift on the same pass. The watcher-of-watchers regress terminates because a silent observer is caught by the same staleness predicate as any other source.
  2. Humans move at the gates through the same events (Q1). One new event type: human_ack with a direction bit (ack | contest), one-tap from Slack. Timeout is itself a predicate: ack absent after N days escalates one level, manager first, MD only on the second timeout; a second ignored timeout writes an unowned_escalation event that caps the deal's forecast band, so silence carries a visible cost. The rep grace window is a versioned predicate parameter, never manager discretion.
  3. Slack topology, two owners, no third notifier (Q2). coaching-agent owns all rep DMs (Technique touches, one-tap ack/contest inside a 3-second interaction budget); deal-health-agent owns manager escalations. Disputes are a thread-reply parser emitting a Level 2 evidence event with source=rep. Staleness shows the rep an honesty banner on the prep card; the manager gets the SLO alert.
  4. Hardening (Q3, ranked the top build priority). Per-source source_heartbeat events in the ledger, because the novelty rule cannot distinguish a deal going dark from a dead Grain webhook; staleness SLOs as predicates; dead-letter handling for unresolved gates; idempotency keys on handoff replay; batched re-derivation with backpressure; per-deal gate_version pinning at G1 entry with explicit migration events (routine version bumps never retroactively re-derive); golden-set replay harness required before the first gate_version bump.
  5. Build order (Q5). (a) Predicates-as-data promoted from open item to load-bearing deliverable: versioned JSON predicates agents evaluate mechanically. (b) Heartbeats plus the absence observer. (c) WF1-WF2 with the play-map/artifact split: dueness evaluation is pure predicate code at zero tokens; only artifact generation pays LLM cost. (d) WF4/WF5 as schema stubs, with exactly ONE ownership-move event live at launch: the MD-to-PM move at G3, as the existence proof that "same event, two audiences" works in production (the other five stay stubs; WF4 agents deferred; MD-to-PM decay is a real revenue leak so this one earns its webhook). Forecast calibration stays deferred behind the backtest.

Corrections against the coordinator synthesis: the golden-set replay harness is required BEFORE anything ships live (majority position; "versioned is not regression-tested"), and the second-ignored-timeout rule is adopted as proposed and uncontested: an unowned_escalation event caps the deal's forecast band until acked, so human silence shows up in the number leadership reads instead of evaporating.

Flagged for Dan, the only residual disagreements: golden-set timing (one member held out for before-first-gate-version-bump; majority overruled) and WF4 event liveness (resolved by the one-live-event compromise above).

8. Open items carried to the spiced session