Skip to content

Blue team tasks: fix transport dedup, migrate CI generation to DSL - #93

Closed
briansrls wants to merge 1 commit into
mainfrom
claude/blue-team-tasks-CIb8C
Closed

briansrls wants to merge 1 commit into
mainfrom
claude/blue-team-tasks-CIb8C

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

BT-E1: Fix transport node deduplication bug in daglang-lower where
endpoint_use_count HashMap was declared inside per-module loop, causing
cross-module service calls to wire duplicate edges to shared prepare nodes.
Moved declaration outside the loop so counts are tracked globally.

CG-1:5: Migrate CI YAML generation from Rust to DSL:

  • Create dsl/std/ci.dag with CI model types (CiWorkflow, CiJob, CiStep,
    CiTrigger, CiPermission, CiCache, CiCheckout, CiRunner, CiProvider)
    and tautological data (rust_cache, cargo_ci_env, default_checkout)
  • Create dsl/std/ci_render.dag with pure rendering functions for both
    GitHub Actions and GitLab CI (15 composable fn items)
  • Create dsl/tools/cigen.dag with extern func discover_ci_config() bridge
    and func cigen() entrypoint that renders both providers via content_upsert
  • Wire cmd_cigen() in codegen_cli.rs to DSL tool via
    build_dsl_graph_for_entrypoint, deleting ~160 lines of Rust generation code
  • Add DiscoverCiConfigOp extern impl serializing permissions, secrets,
    and tool commands from workspace metadata
  • CG-5 evaluated: all RenderConfig/CiRenderer code still actively used
    by provider impls and makegen/ci_render.rs — no dead code to remove

CT-4: Update annotation cleanup status to Done in tasks.md.

Test infrastructure updates:

  • Extern ratchet baselines: 2→3 declarations, 6→7 impls
  • Corpus inventory: add 3 new .dag files
  • Module graph snapshot: add 3 new module dependency counts
  • Passthrough callable allowlist: add 7 new entries
  • Makefile golden snapshot: regenerated with cigen tool target
  • Tool registration: add cigen to non-workspace-dispatch exclusion
  • Commit policies: CI YAML files as BootstrapSeed

https://claude.ai/code/session_01PTAqwMfMHhNuCpCwPYThoP

BT-E1: Fix transport node deduplication bug in daglang-lower where
endpoint_use_count HashMap was declared inside per-module loop, causing
cross-module service calls to wire duplicate edges to shared prepare nodes.
Moved declaration outside the loop so counts are tracked globally.

CG-1:5: Migrate CI YAML generation from Rust to DSL:
- Create dsl/std/ci.dag with CI model types (CiWorkflow, CiJob, CiStep,
  CiTrigger, CiPermission, CiCache, CiCheckout, CiRunner, CiProvider)
  and tautological data (rust_cache, cargo_ci_env, default_checkout)
- Create dsl/std/ci_render.dag with pure rendering functions for both
  GitHub Actions and GitLab CI (15 composable fn items)
- Create dsl/tools/cigen.dag with extern func discover_ci_config() bridge
  and func cigen() entrypoint that renders both providers via content_upsert
- Wire cmd_cigen() in codegen_cli.rs to DSL tool via
  build_dsl_graph_for_entrypoint, deleting ~160 lines of Rust generation code
- Add DiscoverCiConfigOp extern impl serializing permissions, secrets,
  and tool commands from workspace metadata
- CG-5 evaluated: all RenderConfig/CiRenderer code still actively used
  by provider impls and makegen/ci_render.rs — no dead code to remove

CT-4: Update annotation cleanup status to Done in tasks.md.

Test infrastructure updates:
- Extern ratchet baselines: 2→3 declarations, 6→7 impls
- Corpus inventory: add 3 new .dag files
- Module graph snapshot: add 3 new module dependency counts
- Passthrough callable allowlist: add 7 new entries
- Makefile golden snapshot: regenerated with cigen tool target
- Tool registration: add cigen to non-workspace-dispatch exclusion
- Commit policies: CI YAML files as BootstrapSeed

https://claude.ai/code/session_01PTAqwMfMHhNuCpCwPYThoP
@briansrls briansrls closed this Feb 28, 2026
briansrls added a commit that referenced this pull request May 9, 2026
* feat(v3): land CRDT cost-basis carriers and gate #93 demo test

- Add CostBasisKind + CostBasisDeclaration to lenses/cost.dag per cost-basis audit.
- Add t_las_crdt_cost_basis_demo fixture (§4.2 apply_lens target as comments).
- Integration tests: composed symbolic cost vs O(log replicas) per-op budget using
  dominates; large-stack threads for symbolic-cost dimension walks.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* chore(sg0): ratchet hand-authored test list for t_las CRDT demo

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* test(v3): split gate #93 dominates assertions; share cached compile

Addresses api-review exploratory note on TESTING.md one-claim-per-test: two
focused tests plus crdt_field_dimension_ok helper and cached_compile_to_dag.

Skipped optional fixture data pin: CostBasisKind = PerWrite caused a semantic
compile failure in the test fixture module (follow-up if a structural pin is
still desired).

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* docs(v3): note normalized SymbolicCost at root for CRDT cost demo

Explains why composed cost can be Linear(num_writes) while per-op budget stays
Log(replicas); dominance assertions remain the behavioral witness.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* test(v3): cite SizeVariable substrate for CRDT cost demo budget helper

SizeVariable is source_port + display_name: String? in algebra.dag; refactor to
size_var() matching lane2 symbolic-cost tests. Addresses inline review claiming
missing display_name (substrate has had the field since v3 std algebra).

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* chore(v3): regen lens_cost_symbolic after CostBasis carriers in cost.dag

New CostBasisKind/CostBasisDeclaration types in lenses/cost.dag must appear in
lens_cost_symbolic_generated.rs (P2 emitter parity). Refreshed via:
  cargo run -p v3-compiler --bin regen_lens -- --lens cost_symbolic

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* test(v3): tie CRDT demo to CostBasisDeclaration + re-export carriers

- Document that LinearCost dominates any LogCost in MVP dominates(), so the old
  composed-vs-per_op check was vacuous.
- Build an in-test CostBasisDeclaration (PerWrite, LogCost(replicas), subject +
  span from my_crdt_field) so §4.2 per-write basis evidence flows through the
  cost-lens carrier; use basis.cost in the non-vacuous !dominates ceiling test.
- Re-export CostBasisDeclaration and CostBasisKind from v3_compiler::lens_cost_symbolic.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(v3): symbolic-cost Div → LogCost + CRDT basis lens-table witnesses

- cost.dag: dispatch TransformTarget::Operator(Div) to LogCost(dividend port) so
  checked Int divide is visible in compute_symbolic_costs (E-P narrow fix).
- Regenerate lens_cost_symbolic_generated.rs; export compute_symbolic_costs.
- t_las_crdt tests: align CostBasisDeclaration.cost with merge-step dividend
  port, assert Log hits the lens table and basis.cost matches a Hit row; clarify
  SizeVariable/algebra + vacuous Linear>Log in module docs.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* docs(v3): repair CRDT cost-basis demo module doc + Div authority note

- Fix fragmented module-level prose after merge (Practice 4 / gate story unchanged).
- Align per_write_log_replicas_budget comment with transform_cost_for_target Operator(Div).

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* feat(v3): single-authority CostBasisDeclaration builder from Dag

- Add cost_basis_declaration::build_per_write_log_cost_basis_declaration (P2): derives
  PerWrite LogCost(merge param) + DeclarationId + span from compiled binds; tests use
  it instead of hand-assembling the generated carrier.
- Anchor consumer in lenses.cost next to CostBasisDeclaration; SG-0 census + pub re-export.
- Refresh CRDT demo module docs to cite the builder as the declared consumer boundary.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* ci: classify cost-basis types in compiler-std ratchet + stage0 exclude

- Add CostBasisKind/CostBasisDeclaration to POSITIVE_ROWS in check-compiler-std-ratchet (#642).
- List cost_basis_declaration.rs in compiler.dag hand_maintained_src so stage0 clean/copy preserves it.
- Update compiler-std consolidation thesis table for cost.dag type count.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(cost): compose Div transform_cost with log surcharge + regression

- transform_cost_for_target(Div): chain operand fold (transform_cost) before
  LogCost(dividend) so expensive operands are not dropped (PR #2299).
- Regenerate lens_cost_symbolic projection.
- Re-export transform_cost_for_target for lens tests.
- Add lane2 test: dominate old Constant+Log under-approx when dividend is
  Linear; keep Log for cheap param-like operands (sum normalization drops
  Log when Linear dominates).

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(v3): fail-closed CostBasisDeclaration builder (codex #2299)

Replace panicking build_per_write_log_cost_basis_declaration with
try_build_per_write_log_cost_basis_declaration returning
CostBasisDeclarationBuildError. Re-export the error type.

- SizeVariable already matches algebra.dag (source_port + display_name) in
  dag_cost_generated.rs; Div already composes transform_cost + LogCost — those
  review bullets were stale.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* ci: optional SG-0 PR-body append file for agent branches

Merge scripts/ci-merge/sg0-pr-body-append.<PR#>.txt into PR_BODY before
check-pr-sg0-net-shrink-discipline when present (fixes CI when editors
cannot update GitHub PR description). Add machine-readable lines for #2299.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* ci: fix SG-0 declared hand-path delta (+2 after rebase vs main)

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(v3): resolve cost-basis workflow bind via Declaration::Arrow UserDefined

Codex/P2: subject + span must come from the same authority — walk
declaration_by_name → TypeConnective::Arrow → ArrowBody::UserDefined(BindNodeId)
for the workflow span bind; keep name scan only for merge_step helper.
Add typed build errors for non-Arrow / non-UserDefined bodies.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* docs(cost): scaffold PeakMemory CostBasisKind + #1954 trigger (P5)

Per inline review: PeakMemory had no named consumer; classify it 🟡 SCAFFOLD
with dissolution trigger #1954, keep PerWrite/PerCall terminal, restore
CostBasisDeclaration type block accidentally dropped in edit.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(v3): fail-closed Div empty operands + basis vs lens Log witness

- cost.dag: Div with Empty operand list → miss_symbolic_cost_lookup (regen lens).
- try_build_per_write_log_cost_basis_declaration: require LogCost(dividend_port)
  row in compute_symbolic_costs merge param port (MergeStepLacksLogCostWitness).
- Integration: merge step without divide rejects; lane2 asserts Div([])->Miss.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* docs(cost): inline PeakMemory scaffold note on CostBasisKind variant

Clarifies at the variant site that PeakMemory is 🟡 SCAFFOLD (#1954), not a
live terminal — addresses inline review that only skimmed the coproduct block.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(v3): resolve merge-step cost basis via ArrowBody::UserDefined (P2)

Drop BindNode.name scan; use the same declaration -> Arrow -> UserDefined bind
path for the merge helper as for the workflow subject. Remove unused BindNotFound;
rename merge-step error fields to *declaration* for accuracy.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* docs(test): honest gate #93 scoping — interim receipt vs §4.2 fold

Module docs no longer read as full closure: name ROADMAP gate id but state
explicitly that apply_lens + authored CostBasisDeclaration rows folded into
compute_symbolic_costs are follow-on (same gate tracks debt). Align
cost_basis_declaration crate docs to the same slice boundary.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

* fix(v3): CostBasisDeclaration.subject uses SectionRef (T-LAS §2 / audit)

- cost.dag: import SectionRef from v3.std.lens_application; document NodeScope path.
- dag.rs: add SectionRef Rust mirror (authority lens_application.dag).
- regen_lens cost_symbolic; try_build wraps workflow id in DeclarationScope.
- Integration test asserts SectionRef::DeclarationScope subject.

Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Brian Searls <briansrls@users.noreply.github.com>
@briansrls
briansrls deleted the claude/blue-team-tasks-CIb8C branch June 1, 2026 18:41
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