From 875633a69d93aea3879b9b6408965cbadbbcb4cd Mon Sep 17 00:00:00 2001 From: beads/crew/fang Date: Thu, 1 Jan 2026 15:35:22 -0800 Subject: [PATCH] bd sync: 2026-01-01 15:35:22 --- .beads/issues.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 08918538..39879e5f 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -200,7 +200,7 @@ {"id":"bd-7z4","title":"Add tests for delete operations","description":"Core delete functionality including deleteViaDaemon, createTombstone, and deleteIssue functions have 0% coverage. These are critical for data integrity and need comprehensive test coverage.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-18T07:00:34.867680882-07:00","updated_at":"2025-12-23T23:48:50.087306-08:00","closed_at":"2025-12-23T23:48:50.087306-08:00","dependencies":[{"issue_id":"bd-7z4","depends_on_id":"bd-6ss","type":"discovered-from","created_at":"2025-12-18T07:00:34.870254935-07:00","created_by":"matt"}]} {"id":"bd-7zka","title":"Implement formula features: Step.Condition and Step.Gate","description":"Multiple formula features in internal/formula/types.go are marked as \"Not yet implemented\":\n\nIMPLEMENTED (TODOs removed):\n- Step.Expand: Inline expansion - implemented in ApplyInlineExpansions (expand.go)\n- Step.ExpandVars: Variable overrides for expansion - implemented alongside Expand\n\nSTILL NOT IMPLEMENTED (TODOs remain):\n- Step.Condition: Make step optional based on variable (types.go:177-180)\n- Step.Gate: Async wait condition for step (types.go:185-187)\n- Gate struct: Schema defined but not processed in bd cook (types.go:209-210)\n\nFile: internal/formula/types.go","status":"open","priority":3,"issue_type":"feature","created_at":"2025-12-28T16:32:54.493002-08:00","created_by":"stevey","updated_at":"2025-12-30T19:32:30.362068-08:00"} {"id":"bd-7zka.1","title":"Implement Step.Condition evaluation in bd cook","description":"## Summary\nImplement conditional step execution based on variable values.\n\n## Location\n- Schema: `internal/formula/types.go:177-180`\n- Implement in: `internal/formula/cook.go` (or new file `condition.go`)\n\n## Current Schema\n```go\n// Condition makes this step optional based on a variable.\n// Format: \"{{var}}\" (truthy) or \"{{var}} == value\".\n// TODO(bd-7zka): Not yet implemented in bd cook. Filed as future work.\nCondition string `json:\"condition,omitempty\"`\n```\n\n## Implementation\n\n### Parsing\nSupport two formats:\n1. `\"{{var}}\"` - truthy check (non-empty, non-\"false\", non-\"0\")\n2. `\"{{var}} == value\"` - equality check\n\n```go\nfunc evaluateCondition(condition string, vars map[string]string) (bool, error) {\n // Check for equality format\n if strings.Contains(condition, \"==\") {\n parts := strings.SplitN(condition, \"==\", 2)\n varExpr := strings.TrimSpace(parts[0])\n expected := strings.TrimSpace(parts[1])\n \n // Extract variable name from {{var}}\n varName := extractVarName(varExpr)\n actual := vars[varName]\n return actual == expected, nil\n }\n \n // Truthy check\n varName := extractVarName(condition)\n val := vars[varName]\n return val != \"\" \u0026\u0026 val != \"false\" \u0026\u0026 val != \"0\", nil\n}\n```\n\n### Integration with bd cook\nIn the step processing loop, check condition before creating issue:\n```go\nif step.Condition != \"\" {\n include, err := evaluateCondition(step.Condition, vars)\n if err != nil {\n return fmt.Errorf(\"invalid condition %q: %w\", step.Condition, err)\n }\n if !include {\n continue // Skip this step\n }\n}\n```\n\n## Example Usage\n```yaml\nsteps:\n - title: \"Run integration tests\"\n condition: \"{{run_integration}}\"\n \n - title: \"Deploy to staging\"\n condition: \"{{environment}} == staging\"\n```\n\n## Testing\n- Test truthy evaluation (empty, \"false\", \"0\", valid value)\n- Test equality check\n- Test invalid condition format\n- Test missing variable (should be falsy)\n\n## Acceptance Criteria\n- [x] Truthy conditions work\n- [x] Equality conditions work\n- [x] Steps are skipped when condition is false\n- [x] Clear error on malformed condition\n- [x] Works with variable substitution","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-30T19:31:57.979217-08:00","created_by":"beads/crew/emma","updated_at":"2025-12-31T00:33:25.954831-08:00","closed_at":"2025-12-31T00:33:25.954831-08:00","close_reason":"Implemented Step.Condition evaluation in stepcondition.go with tests","dependencies":[{"issue_id":"bd-7zka.1","depends_on_id":"bd-7zka","type":"parent-child","created_at":"2025-12-30T19:31:57.97973-08:00","created_by":"beads/crew/emma"}]} -{"id":"bd-7zka.2","title":"Implement Gate evaluation in bd cook","description":"$(cat /tmp/gate-desc-fixed.md)","status":"open","priority":3,"issue_type":"task","created_at":"2025-12-30T19:32:19.664542-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-01T15:04:25.703462-08:00","dependencies":[{"issue_id":"bd-7zka.2","depends_on_id":"bd-7zka","type":"parent-child","created_at":"2025-12-30T19:32:19.666332-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-7zka.2","depends_on_id":"bd-0sgd","type":"related","created_at":"2026-01-01T15:04:06.917484-08:00","created_by":"beads/crew/fang"}]} +{"id":"bd-7zka.2","title":"Implement Gate evaluation in bd cook","description":"## Summary\nImplement async wait conditions (gates) for formula steps.\n\n## Design Decision: RESOLVED\n\n**Gates are issues.** A gate is a `bd-gate-*` prefixed issue that blocks the step it guards.\n\n### Gate Issue Structure\n```\nbd-gate-abc: Gate: gh:run test.yml\n type: gate\n gate_type: gh:run\n gate_target: test.yml\n gate_timeout: 1h\n gate_created: 2025-01-01T12:00:00Z\n blocks: bd-xyz # The step issue waiting on this gate\n```\n\n### Gate Types and Watchers\n\n| Gate Type | Signal Source | Watcher | Trigger |\n|-----------|---------------|---------|---------|\n| bead (cross-rig) | bd sync | Existing dep resolution | Sync |\n| gh:run | GitHub API | Refinery | Patrol poll |\n| gh:pr | GitHub API | Refinery | Patrol poll |\n| timer | Clock | Witness | Patrol cycle |\n| human | Human | None | bd close |\n| mail | Inbox | Deacon | Mail receipt (future) |\n\n### Visibility\n- bd list hides gate-type issues by default\n- bd gate list shows all open gates\n- bd mol show displays gates inline in molecule view\n\n### Timeouts\n- Gate timeout triggers escalation to Deacon/Overseer inbox\n- See: bd-0sgd (escalation inbox design)\n\n## Implementation Phases\n\n### Phase 1: Gate Issues + Human Gates\n- bd cook creates bd-gate-* issues for steps with gates\n- Gate issues block the next step via dependency\n- Human gates: just bd close bd-gate-xxx\n- bd list filters out type=gate by default\n- bd gate list command\n\n### Phase 2: Timer Gates\n- Witness patrol includes bd gate check --type=timer\n- Gate metadata: timeout, created_at\n- Expired gates escalate (not auto-close)\n\n### Phase 3: GitHub Gates\n- Refinery patrol includes bd gate check --type=gh\n- Uses gh CLI to check workflow/PR status\n- Resolved gates close\n\n### Phase 4: Cross-Rig Bead Gates\n- Leverage existing external dep resolution\n- bd cook creates gate with external dep on target bead\n- bd ready / bd sync resolves naturally\n\n### Phase 5: Mail Gates (future)\n- Deacon watches for mail responses\n- Complex - may YAGNI\n\n## Commands\n\n```bash\nbd gate list # Show open gates\nbd gate check # Evaluate all gates\nbd gate check --type=timer # Check only timer gates\nbd gate check --type=gh # Check only GitHub gates\nbd gate resolve \u003cid\u003e [--reason] # Force-close a gate\n```\n\n## Location\n- Schema: internal/formula/types.go\n- Gate issue creation: internal/formula/cook.go\n- Gate commands: cmd/bd/gate.go (new)\n- List filtering: cmd/bd/list.go\n\n## Acceptance Criteria\n- [ ] bd cook creates bd-gate-* issues for gated steps\n- [ ] Gate issues block subsequent steps\n- [ ] bd list hides gates by default\n- [ ] bd gate list shows all gates\n- [ ] bd gate check --type=timer works (Witness integration)\n- [ ] bd mol show displays gates in molecule view\n- [ ] Human gates closeable via bd close","status":"open","priority":3,"issue_type":"task","created_at":"2025-12-30T19:32:19.664542-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-01T15:35:02.840468-08:00","dependencies":[{"issue_id":"bd-7zka.2","depends_on_id":"bd-7zka","type":"parent-child","created_at":"2025-12-30T19:32:19.666332-08:00","created_by":"beads/crew/emma"},{"issue_id":"bd-7zka.2","depends_on_id":"bd-0sgd","type":"related","created_at":"2026-01-01T15:04:06.917484-08:00","created_by":"beads/crew/fang"}]} {"id":"bd-801b","title":"Merge: bd-bqcc","description":"branch: polecat/capable\ntarget: main\nsource_issue: bd-bqcc\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-23T00:26:04.306756-08:00","updated_at":"2025-12-23T01:33:25.728087-08:00","closed_at":"2025-12-23T01:33:25.728087-08:00"} {"id":"bd-83f5","title":"Remove top-level comment alias","description":"Remove 'comment' as top-level command. Users should use 'comments add' instead. Reduces command surface area.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-28T12:59:12.33579-08:00","created_by":"stevey","updated_at":"2025-12-28T13:06:53.335122-08:00","closed_at":"2025-12-28T13:06:53.335122-08:00"} {"id":"bd-89f89fc0","title":"Remove unreachable RPC methods","description":"Several RPC server and client methods are unreachable and should be removed:\n\nServer methods (internal/rpc/server.go):\n- `Server.GetLastImportTime` (line 2116)\n- `Server.SetLastImportTime` (line 2123)\n- `Server.findJSONLPath` (line 2255)\n\nClient methods (internal/rpc/client.go):\n- `Client.Import` (line 311) - RPC import not used (daemon uses autoimport)\n\nEvidence:\n```bash\ngo run golang.org/x/tools/cmd/deadcode@latest -test ./...\n```\n\nImpact: Removes ~80 LOC of unused RPC code","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-10-28T16:20:02.432202-07:00","updated_at":"2025-12-25T01:21:01.952723-08:00","deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"}