Repository navigation
refactor(examples): pivot L5 triage to raw Temporal + add activities (#74) - #230
Merged
Merged
Conversation
…74) The triage workflow needs custom activities (the agent), which chant Ops don't support — Op codegen only re-exports pre-built lexicon activities, so the alert-triage.op.ts skeleton from #229 could never generate a working worker. Pivot to chant's documented "Raw Temporal + chant" model (as temporal-crdb-deploy uses): chant synthesizes the manifests, the triage workflow is hand-written Temporal. - Remove alert-triage.op.ts (wrong abstraction). - Add activities/triage.ts — raw Temporal activities (classifyAlert, gatherContext, proposeRemediation, notifyOutcome). Deterministic stubs by default; proposeRemediation calls Claude when ANTHROPIC_API_KEY is set (@anthropic-ai/sdk dynamic-imported, opt-in; model via ANTHROPIC_MODEL). - activities/triage.test.ts — unit tests for the stub path (CI-safe, no key). - vitest.config.ts — include examples/alert-triage/**/*.test.ts so the app's colocated tests run in CI (still not globbing examples/** — fargate docker). - App code lives outside src/ so `chant lint src` stays clean (src/ is chant resources only). - README + getting-started L5 row updated to the raw-Temporal model. examples.test.ts: 164 passed; activity unit tests: 5 passed; lint clean. Part of #74. Follow-ups: the Temporal workflow + worker, webhook source, WatchOp. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 7, 2026
Closed
lex00
added a commit
that referenced
this pull request
Jun 7, 2026
…233) Wire the triage activities (#230) into a runnable raw Temporal workflow + worker, with a time-skipping test — the last L5 piece that carries a real CI check. - activities/workflow.ts — triage workflow: classify → gather context → propose → approval gate → notify. Safe remediations apply directly; risky ones wait on the `approve-remediation` signal (condition, 12h) then are held. `import type` keeps the activity module out of the deterministic workflow bundle. - activities/worker.ts — registers activities + workflow; connects via the `local` profile in chant.config.ts. `npm run worker`. - activities/workflow.test.ts — TestWorkflowEnvironment (time-skipping), modeled on the temporal lexicon's #161 harness: asserts phase order, gate-clears-on- signal, safe-path-skips-gate, and unapproved-risky-waits-out-the-12h-gate. - package.json — @temporalio/{workflow,worker,testing} + a `worker` script. - README — workflow/worker section and how to run it locally. Workflow test runs in CI (under the examples/alert-triage/**/*.test.ts include): 3 passed. Full examples suite 200 passed; lint + eslint clean. Closes #231. Part of #74 / #216. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Course-correction for L5. The triage workflow needs custom activities (they run the agent), which chant Ops don't support — Op codegen only re-exports pre-built lexicon activities, so the
alert-triage.op.tsskeleton from #229 could never generate a working worker. Pivot to chant's documented "Raw Temporal + chant" model (same split astemporal-crdb-deploy): chant synthesizes the manifests; the triage workflow is hand-written Temporal.Changes
alert-triage.op.ts(wrong abstraction).activities/triage.ts— raw Temporal activities (classifyAlert,gatherContext,proposeRemediation,notifyOutcome). Deterministic stubs by default;proposeRemediationcalls Claude whenANTHROPIC_API_KEYis set (@anthropic-ai/sdkdynamic-imported, opt-in; model viaANTHROPIC_MODEL, defaultclaude-sonnet-4-6).activities/triage.test.ts— unit tests for the stub path (CI-safe, no key).vitest.config.ts— includeexamples/alert-triage/**/*.test.tsso the app's colocated tests run in CI (still not globbingexamples/**— fargate docker e2e).src/sochant lint srcstays clean (src/is chant resources only).Validation
eslint packages/clean.Part of #74. Follow-ups: the Temporal workflow + worker, webhook source,
WatchOpsecond source.🤖 Generated with Claude Code