feat(config): add on_event.failed_run, serve JSON schema, and publish repo config reference#123
Merged
feat(config): add on_event.failed_run, serve JSON schema, and publish repo config reference#123
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
task-action | 3ba222e | Apr 22 2026, 10:30 PM |
Contributor
Author
ApprovabilityVerdict: Needs human review This PR adds schema definitions for a future You can customize Macroscope's approvability policy. Learn more. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27e55e4 to
3ba222e
Compare
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.

Summary
Extends
.code-factory/config.tomlwith a new[[on_event.failed_run]]section, serves a machine-readable JSON Schema atGET /schema.jsonfor editor integration, and publishes a human-readable reference atdocs/repo-config.md. No consumer ofon_event.failed_runis added in this PR — this is schema plumbing plus docs only.What ships
Schema extensions (
src/config/repo-config-schema.ts)StoredFailedRunEventSchema/StoredOnEventSchemaon the sparse (write-side) shape.workflowsandbranchesare required non-empty arrays;prompt_additionsis optional.ResolvedOnEventSchemaon the resolved (read-side) shape, wired with.prefault({})+ inner.default([])so consumers always seeon_event.failed_run: []when the section is absent.issue.path + issue.messageonly, neverissue.input.GET /schema.jsonendpoint (src/main.ts)z.toJSONSchema(RepoConfigSettingsSchema, { io: "input", target: "draft-2020-12" })so optional-with-default fields carry adefaultkeyword.content-type: application/schema+json; charset=utf-8andcache-control: public, max-age=300.$idset tohttps://task-action.xmtp.team/schema.json.VolumeSizeSchemauses.transform()which causesz.toJSONSchemato drop thedefaultkeyword onsandbox.volumes[].size. The workaround re-injectsdefault: \"10Gi\"and throws loudly at module load if the shape ever drifts.Reference docs (
docs/repo-config.md)#:schemadirective and.taplo.toml.README.md(new Per-repo configuration subsection) andAGENTS.md(Reference list)..code-factory/config.tomlnow carries a#:schemadirective so editors fetch the schema automatically.Non-goals (deliberately deferred)
on_event.failed_run— no event router, no failed-run handler workflow. The block validates today; dispatch is a follow-up.x-taploextension keywords, no build-time static schema asset, no version migration.Test plan
npm run check— 401 tests across 32 files, typecheck/lint/format cleanparseRepoConfigToml — on_event.failed_runcoverage: full entry, optionalprompt_additions, multiple entries (full-shape assertion), unknown-key stripping, four required/non-empty error paths, and a type-mismatch secret-leak regression guard usingexpect.assertions(2)resolveRepoConfigSettings — on_event defaultscoverage:undefined,{}, sparseon_event: {}, and entry passthroughJSON_SCHEMA exportcoverage (11 tests): metadata, alldefaultkeywords,minItems: 1, required-field sets,prompt_additionsNOT required, serializabilityGET /schema.jsoncoverage (3 tests): 200 + headers, body deep-equalsJSON_SCHEMA, non-GET falls through to 404POST /webhooks/githubdispatch, themain.test.tsunknown-route 404 testSpec / task list
docs/plans/2026-04-22-repo-config-schema-extensions-design.mddocs/plans/2026-04-22-repo-config-schema-extensions-tasks.mdAll 19 EARS requirements validated by final spec review.
🤖 Generated with Claude Code
Note
Add
on_event.failed_runschema to repo config and serve it at/schema.json[[on_event.failed_run]]support to repo-config-schema.ts: each entry requires non-emptyworkflowsandbranchesarrays, with an optionalprompt_additionsfield; resolved configs defaulton_event.failed_runto[].JSON_Schemaexport generated from the resolved schema in input mode, with$schema,$id,title, anddescriptionset; a workaround injects thesandbox.volumes[].sizedefault lost during the zod transform, and throws on module load if the path is missing.GET /schema.jsonroute in main.ts that returns the schema withcontent-type: application/schema+jsonand a 5-minute public cache..code-factory/config.tomlformat and editor integration via the served schema.sandbox.volumes[].sizeschema path is absent, which would prevent worker startup if the schema structure changes.Macroscope summarized 3ba222e.