Skip to content

Language cleanup: two workstreams (WS01 mechanical, WS02 data/outcomes) for architecture review#160

Merged
brokenbot merged 1 commit into
mainfrom
language-cleanup
May 25, 2026
Merged

Language cleanup: two workstreams (WS01 mechanical, WS02 data/outcomes) for architecture review#160
brokenbot merged 1 commit into
mainfrom
language-cleanup

Conversation

@handcaught
Copy link
Copy Markdown
Member

Summary

Scopes the Terraform-shaping work the VSCode extension surfaced as two workstreams for architecture review before implementation begins. No code changes yet — just the workstream plans.

  • WS01 — Mechanical schema cleanup. Low-risk, all touch workflow/schema.go: workflow { name = ... } reshape with nested policy, type = string type expressions (drop the hand-rolled parseVariableType / TypeToString), outcome "default" {} replaces the default_outcome attribute, environment refs as traversals (environment = environment.shell.ci), register cty/function/stdlib for the full Terraform-equivalent function set (~50 funcs incl. startswith/substr/replace/format/etc.), VSCode grammar update. Hand-rolled duplicates (jsonencode, base64encode, etc.) are dropped in favor of stdlib — no override fallback.

  • WS02 — data block + outcome semantics. Higher-risk, touches the engine runtime: outcome next becomes a node traversal (step.foo, state.done) with bare return/continue keywords replacing the magic-string sentinels; shared_variable is replaced by data "internal" "name" (extensible block, ready for future remote kinds); shared_writes = { ... } becomes per-target write { target = ..., value = ... } blocks inside outcomes (singular write since each updates one target — data.x.y.value = expr can't be an HCL attribute LHS); engine runtime store renamed SharedVarStoreDataStore; VSCode grammar update.

Migration strategy is hard break with helpful errors — same pattern as parse_legacy_reject.go. No dual-support window.

WS01 lands first to absorb mechanical schema churn; WS02 then lands on a clean base.

Branch targets main; once the language-cleanup phase closes, main merges into adapter-v2. Workstream files live in workstreams/language_cleanup/ following the adapter_v2/ precedent.

Test plan

  • Architect review of workstreams/language_cleanup/README.md for phase framing.
  • Architect review of WS01-mechanical-schema-cleanup.md — confirm scope split is correct; flag any concerns about the default_outcomeoutcome "default" {} shape (it's the one item where WS01 changes semantic surface, not just syntax).
  • Architect review of WS02-data-and-outcome-semantics.md — confirm the data "<kind>" "<name>" shape (with only internal supported initially) is the right extension point, and confirm the per-target write { target = ..., value = ... } block shape is acceptable given the HCL grammar constraint that prevents data.x.y.value = expr attribute LHSs.
  • Sign-off on hard-break (no dual-support) migration strategy.

Adds WS01 (mechanical schema cleanup: workflow{}/policy nesting, type
expressions, outcome "default" block, environment traversals, cty
stdlib functions, VSCode grammar) and WS02 (data block + outcome
semantics: next traversals, return/continue keywords, data "internal"
replaces shared_variable, write block replaces shared_writes).

Targets main; merges into adapter-v2 once the language phase closes.
For architecture review before implementation begins.
@brokenbot brokenbot merged commit a894191 into main May 25, 2026
7 checks passed
@brokenbot brokenbot deleted the language-cleanup branch May 25, 2026 18:59
@handcaught handcaught restored the language-cleanup branch May 25, 2026 19:02
brokenbot added a commit that referenced this pull request May 26, 2026
* language_cleanup: scope two workstreams for HCL Terraform-shaping (#160)

Adds WS01 (mechanical schema cleanup: workflow{}/policy nesting, type
expressions, outcome "default" block, environment traversals, cty
stdlib functions, VSCode grammar) and WS02 (data block + outcome
semantics: next traversals, return/continue keywords, data "internal"
replaces shared_variable, write block replaces shared_writes).

Targets main; merges into adapter-v2 once the language phase closes.
For architecture review before implementation begins.

Co-authored-by: Dave Sanderson <dave@brokenbots.net>

* workstream: complete workstreams/language_cleanup/WS01-mechanical-sch… (#162)

* workstream: complete workstreams/language_cleanup/WS01-mechanical-schema-cleanup.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* workstream: complete workstreams/language_cleanup/WS01-mechanical-schema-cleanup.md

* fix: address PR review feedback - bare traversal docs, stale comments, adapter env test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: increase TestClientReconnectMultipleFailures timeout for CI runners

Under -race the multiple-reconnect path can exceed 10s on slower CI
runners. Bump to 20s and add progress logging so future flakes are
easier to diagnose.

---------

Co-authored-by: Dave <dave@brokenbots.dev>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Dave Sanderson <dave@brokenbots.net>
Co-authored-by: Dave Sanderson <dave@nullop.io>
Co-authored-by: Dave <dave@brokenbots.dev>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants