@@ -33,7 +33,26 @@ business logic. Every subsequent task assumes this foundation exists.
3333 ** Verify:** an agent reading the file can answer "how do I build and test this project"
3434 without additional context.
3535
36- - [ ] 0.6 Set up structured logging with ` slog ` : configure default logger with key=value
36+ - [ ] 0.6 Research and write ADR-0004: Workflow file format. Evaluate YAML front matter in
37+ Markdown (current spec) vs TOML front matter vs pure YAML vs separate config + prompt
38+ files. Consider: single-file UX for workflow authors, parsing complexity, ecosystem
39+ familiarity (TOML gaining traction in Go/Rust ecosystems, YAML dominant in DevOps),
40+ front matter delimiter conventions, and how prompt body is separated from config.
41+ Document the decision in ` docs/decisions/0004-workflow-file-format.md ` .
42+ ** Verify:** ADR exists with status ` accepted ` , covers at least 3 alternatives, and
43+ ` docs/decisions/README.md ` index is updated.
44+
45+ - [ ] 0.7 Research and write ADR-0005: Prompt template engine. Evaluate Go ` text/template `
46+ with ` missingkey=error ` vs ` pongo2 ` (Jinja2-like) vs Handlebars via Go library vs
47+ simple string interpolation. Consider: this is user-facing API surface — workflow
48+ authors write templates, and changing the engine breaks all existing workflows.
49+ Trade-offs: stdlib simplicity and zero dependencies vs richer filters/syntax, agent
50+ generation quality for each syntax, error message clarity on template mistakes.
51+ Document the decision in ` docs/decisions/0005-prompt-template-engine.md ` .
52+ ** Verify:** ADR exists with status ` accepted ` , covers at least 3 alternatives, and
53+ ` docs/decisions/README.md ` index is updated.
54+
55+ - [ ] 0.8 Set up structured logging with ` slog ` : configure default logger with key=value
3756 output, define helper to create sub-loggers with ` issue_id ` , ` issue_identifier ` , and
3857 ` session_id ` context fields. This foundation is used by all subsequent milestones.
3958 ** Verify:** unit test creates a logger with context fields, writes a message, confirms
@@ -44,9 +63,11 @@ business logic. Every subsequent task assumes this foundation exists.
4463Parse ` WORKFLOW.md ` , expose typed config, and support dynamic reload. No orchestration logic
4564yet - just the ability to read, validate, and watch the workflow file.
4665
47- - [ ] 1.1 Research YAML parsing libraries for Go (` gopkg.in/yaml.v3 ` , ` github.com/goccy/go-yaml ` )
48- and Go template engine behavior (` text/template ` strict mode). Select libraries and add
49- them to ` go.mod ` .
66+ - [ ] 1.1 Select and add parsing libraries to ` go.mod ` based on ADR-0004 (workflow file format)
67+ and ADR-0005 (template engine) decisions. If YAML was chosen: evaluate ` gopkg.in/yaml.v3 `
68+ vs ` github.com/goccy/go-yaml ` . If TOML: evaluate ` github.com/BurntSushi/toml ` vs
69+ ` github.com/pelletier/go-toml/v2 ` . For the template engine, add the library selected in
70+ ADR-0005.
5071 ** Verify:** ` go mod tidy ` succeeds, dependencies resolve.
5172
5273- [ ] 1.2 Implement the workflow loader: read a file, split YAML front matter from Markdown
@@ -370,33 +391,44 @@ the system does real work.
370391
371392## Milestone 8: Observability
372393
373- HTTP dashboard, JSON API, and enhanced logging. The system should be monitorable by
374- operators after this milestone. Note: basic structured logging infrastructure was set up
375- in task 0.6; this milestone adds the observability surfaces that consume orchestrator state.
376-
377- - [ ] 8.1 Audit and enhance structured logging across all modules: confirm ` issue_id ` ,
394+ Observability surfaces. The system should be monitorable by operators after this milestone.
395+ Basic structured logging was set up in task 0.8; this milestone decides the observability
396+ model (ADR-0008), enhances logging, and implements the chosen surfaces.
397+
398+ - [ ] 8.1 Research and write ADR-0008: Observability model. Evaluate embedded HTTP server
399+ with JSON API + HTML dashboard (current spec) vs Prometheus ` /metrics ` endpoint
400+ consumed by external Grafana vs structured logs only (consumed by log aggregation) vs
401+ Unix socket + reverse proxy. Consider: the "single binary, zero infrastructure" deployment
402+ model vs integration with existing monitoring stacks (most Go production services use
403+ Prometheus). The embedded dashboard optimizes for zero-dependency operation but diverges
404+ from industry convention. Document the decision in
405+ ` docs/decisions/0008-observability-model.md ` .
406+ ** Verify:** ADR exists with status ` accepted ` , covers at least 3 alternatives, and
407+ ` docs/decisions/README.md ` index is updated.
408+
409+ - [ ] 8.2 Audit and enhance structured logging across all modules: confirm ` issue_id ` ,
378410 ` issue_identifier ` , and ` session_id ` context fields are present on all relevant log
379411 lines (dispatch, retry, reconciliation, worker lifecycle, agent events). Add any
380412 missing context. Confirm key=value format is consistent.
381413 ** Verify:** run the orchestrator with mock adapters, grep logs for structured fields,
382414 confirm they are present and consistent across all lifecycle events.
383415
384- - [ ] 8.2 Implement the runtime snapshot function (Section 13.3): return running sessions
416+ - [ ] 8.3 Implement the runtime snapshot function (Section 13.3): return running sessions
385417 (including ` turn_count ` per row), retry queue, agent totals (` input_tokens ` ,
386418 ` output_tokens ` , ` total_tokens ` , ` seconds_running ` computed as cumulative ended-session
387419 time plus active-session elapsed time from ` started_at ` ), and rate limits.
388420 ** Verify:** unit test populates orchestrator state, calls snapshot, confirms all
389421 fields are populated including computed ` seconds_running ` .
390422
391- - [ ] 8.3 Implement the JSON API server (Section 13.7.2): ` GET /api/v1/state ` ,
423+ - [ ] 8.4 Implement the JSON API server (Section 13.7.2): ` GET /api/v1/state ` ,
392424 ` GET /api/v1/<identifier> ` (404 for unknown issues), ` POST /api/v1/refresh ` (202
393425 Accepted). Use Go ` net/http ` and ` encoding/json ` . Bind to loopback by default. Enable
394426 via ` --port ` flag (overrides ` server.port ` from WORKFLOW.md). Return ` 405 ` for
395427 unsupported methods. Use ` {"error":{"code":"...","message":"..."}} ` envelope for errors.
396428 ** Verify:** integration test starts the HTTP server, calls each endpoint, validates
397429 response shapes against the architecture doc (Section 13.7.2).
398430
399- - [ ] 8.4 Implement the HTML dashboard (Section 13.7.1): server-rendered page at ` / ` showing
431+ - [ ] 8.5 Implement the HTML dashboard (Section 13.7.1): server-rendered page at ` / ` showing
400432 running sessions, retry queue, token totals, runtime seconds, recent events. Use Go
401433 ` html/template ` . Add auto-refresh via SSE or meta-refresh.
402434 ** Verify:** start Sortie with ` --port 8080 ` , open ` http://localhost:8080 ` in a browser,
0 commit comments