Skip to content

Simplify nREPL startup and correct incidental-complexity A2 gate#158

Merged
hugoduncan merged 97 commits into
masterfrom
run-simplification
Jun 6, 2026
Merged

Simplify nREPL startup and correct incidental-complexity A2 gate#158
hugoduncan merged 97 commits into
masterfrom
run-simplification

Conversation

@hugoduncan
Copy link
Copy Markdown
Owner

@hugoduncan hugoduncan commented Jun 6, 2026

Summary

This PR contains the completed run-simplification work for Munera tasks 214 and 215.

214 — simplify start-nrepl!

  • Adds a pre-simplification characterization net for psi.app-runtime.nrepl-runtime/start-nrepl! behaviour:
    • bound port is reflected through the EQL/runtime path,
    • .nrepl-port is written/deleted with the expected ownership rules,
    • startup chatter is redirected away from stdout,
    • session publication uses the bound port.
  • Refactors start-nrepl! by extracting cohesive helper seams for the nREPL start mechanics and endpoint publication, preserving behaviour while reducing the target's local comprehension burden.
  • Keeps the change local to app-runtime nREPL startup code/tests; no dispatch/state-boundary migration is introduced.
  • Captures the discovered Gordian A2 net-sum defect as durable knowledge after the original generated acceptance gate proved structurally unsatisfiable for a behaviour-preserving decomplecting extraction.

215 — correct the reduce-incidental-complexity A2 gate

  • Fixes the workflow emitter at .psi/workflows/reduce-incidental-complexity.edn so future generated tasks no longer emit the broken net-sum A2 gate.
  • Replaces A2 with a per-unit relocation guard:
    • B := before(target) from committed before-local.json,
    • A2a: new physical after-rows must satisfy after(u) < B,
    • A2b: pre-existing below-ceiling rows must satisfy after(u) < B,
    • no tunable θ/ε, no net sum.
  • Spells out the deterministic mechanical check over before-local.json + recomputed bb gordian local --json:
    • line-insensitive (ns, var, arity) grouping,
    • before-max(k) for non-unique keys,
    • per-physical-row after(u) checks,
    • multiset change filter for T,
    • line-bearing single-row target exclusion.
  • Updates workflow content-lock tests to lock the corrected A2a/A2b wording and negative-guard against the old net-sum text.
  • Synchronizes docs/CHANGELOG and mementum knowledge:
    • gordian-net-sum-burden-gate-sub-additivity.md records the fix landed and supersedes the earlier after(target) residual-anchor sketch with the committed-baseline after(u) < B form.
    • editing-workflow-emitter-prompts.md captures workflow-emitter editing/test lessons from this work.

Verification

  • Task 214 focused runtime test net:
    • bb clojure:test:scry --namespace psi.app-runtime-nrepl-test7 tests / 30 assertions GREEN.
  • Task 214 static checks:
    • bb lint / targeted clj-kondo checks clean for touched code paths (one pre-existing informational warning noted in task artifacts where applicable).
  • Task 214 Gordian acceptance:
    • target start-nrepl! lcc-total reduced from 6.015383232244966 to 5.549920815558428,
    • extracted seams are below the accepted A2′ ceiling,
    • gordian gate --baseline ... --fail-on new-cycles,new-high-findings --max-new-medium-findings 0 passes.
  • Task 215 workflow-loader/content-lock suite:
    • 3 tests / 215 assertions / 0 failures / 0 errors after the final review passes.
  • Task 215 emitter EDN:
    • EDN round-trip/load check passes; workflow definitions load.
  • Task 215 lint:
    • clj-kondo over the touched workflow-definition test file reports 0 errors / 0 warnings.

Known pre-existing caveat recorded in the task artifacts: a full kaocha --focus invocation can fail while loading an unrelated namespace (psi.agent_session.tool_execution_test → missing psi/metrics/extension on the classpath). The affected workflow-loader suite was isolated and run directly from repo root because those tests read .psi/workflows/ cwd-relative.

Notes

  • Task 214 intentionally left the original generated A2 net-sum failure documented, then task 215 fixes the framework-level source so future generated tasks carry a satisfiable, well-posed A2.
  • Both Munera tasks are closed in this branch:
    • munera/closed/214-simplify-start-nrepl
    • munera/closed/215-correct-incidental-complexity-a2-gate

@hugoduncan hugoduncan force-pushed the run-simplification branch from 1a8dd02 to edfe077 Compare June 6, 2026 03:07
@hugoduncan hugoduncan merged commit 4d5fa8e into master Jun 6, 2026
4 checks passed
@hugoduncan hugoduncan deleted the run-simplification branch June 6, 2026 03:29
@hugoduncan hugoduncan changed the title Improve incidental simplification workflow and TUI startup test coverage Simplify nREPL startup and correct incidental-complexity A2 gate Jun 6, 2026
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.

1 participant