Skip to content

Add backpressure facet with git hooks and setup-note provision writer - #4

Merged
mrsimpson merged 10 commits into
mainfrom
claude/add-backpressure-facet-pyNto
Mar 18, 2026
Merged

Add backpressure facet with git hooks and setup-note provision writer#4
mrsimpson merged 10 commits into
mainfrom
claude/add-backpressure-facet-pyNto

Conversation

@mrsimpson

Copy link
Copy Markdown
Contributor

Summary

  • Backpressure facet: new catalog facet with per-architecture git hooks
    that enforce quality gates silently (emit ✓ on success, surfacing only
    failures). Supports pre-commit lint+build and pre-push unit tests for
    tanstack, nodejs-backend, and java-backend.
  • available() predicate: options declare their own availability based
    on resolved facet deps, keeping architecture-specific variants out of
    core logic.
  • setup-note provision writer: a new writer (setup_notes: string[]
    on LogicalConfig) lets any catalog option emit post-setup instructions
    through the resolution pipeline. Replaces hardcoded arch-specific hints
    in setup.ts with a simple loop over logicalConfig.setup_notes.
  • DRY recipes: shared NODEJS_LINT_BUILD_RECIPE, JAVA_LINT_BUILD_RECIPE,
    NODEJS_UNIT_TEST_RECIPE, JAVA_UNIT_TEST_RECIPE constants eliminate
    duplicated inline recipes across the per-architecture options.

Test plan

  • pnpm -r test passes (162 tests across core, harnesses, cli)
  • pnpm -r build succeeds with no type errors
  • resolver.spec.ts — new setup_notes merging block verifies
    setup-note provisions populate the field end-to-end
  • setup.spec.ts — new test verifies each note in
    logicalConfig.setup_notes is emitted via <clack.log.info>
  • catalog.spec.ts — new test verifies all lint-build-precommit-*
    options carry a setup-note provision with non-empty text
  • registry.spec.ts — updated to expect 8 built-in provision writers
    including setup-note

claude added 10 commits March 17, 2026 23:25
Introduces a new backpressure facet that installs git hook scripts to enforce
quality gates deterministically — no LLM instruction required. Hooks follow the
swallow-on-success pattern (emit ✓ on clean runs, dump output on failure) and
auto-detect the project's build tool (npm/Maven/Cargo/Gradle) at runtime.

New catalog options:
- lint-build-precommit: pre-commit hook running lint + build, plus a WIP-commit
  instruction so hooks fire frequently during agent sessions
- unit-test-prepush: pre-push hook running unit tests

Infrastructure changes:
- New GitHook type and git_hooks field on LogicalConfig
- New git-hooks provision writer (packages/core/src/writers/git-hooks.ts)
- writeGitHooks() utility added to harnesses/src/util.ts
- All 9 harness writers call writeGitHooks() during install

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
TypeScript strict mode requires all LogicalConfig fields. Adds git_hooks: []
to all harness writer test fixtures to satisfy the new required field.

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
The new backpressure facet (multiSelect: true) adds an extra clack.multiselect
call during setup. All integration tests that run setup were missing this mock,
causing the harnesses selection to receive undefined.

Adds .mockResolvedValueOnce([]) for backpressure (no selection) before the
harnesses mock in every affected integration test.

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
- Add Option.available?(deps) for conditional option visibility
- Add sortFacets() (topological sort by dependsOn) to catalog/index.ts
- Add getVisibleOptions() to filter options using available()
- Export sortFacets and getVisibleOptions from @ade/core
- Update setup.ts to sort facets and skip prompts with no visible options
- Rewrite backpressure facet with 6 per-architecture options (tanstack, nodejs-backend, java-backend × lint-build + unit-test) each gated by available()
- Add dependsOn: ["architecture"] to backpressure facet
- Update catalog.spec.ts: remove auto-detect tests, add available/sortFacets/getVisibleOptions tests
- Fix integration tests: remove backpressure mock when architecture is skipped

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
After ade setup installs git hooks, print architecture-specific
instructions so users know what linting/build tooling to configure.
- Node.js architectures: add lint + build scripts to package.json
- Java backend: apply the Checkstyle Gradle plugin

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
Add a setup_notes field to LogicalConfig and a setup-note provision
writer so any option in the catalog can emit post-setup instructions
through the resolver pipeline instead of via hardcoded logic in setup.ts.

- Add setup_notes: string[] to LogicalConfig
- Add "setup-note" to ProvisionWriter union
- Create writers/setup-note.ts that maps config.text → setup_notes
- Register it in createDefaultRegistry()
- Initialize and merge setup_notes in resolver.ts
- Add setup-note provisions to backpressure lint-build options
  (Node.js: hint to add lint+build scripts; Java: hint for Checkstyle plugin)
- Replace hardcoded arch-specific hint in setup.ts with a loop over
  logicalConfig.setup_notes

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
…overage

DRY: lint-build-precommit-tanstack and -nodejs-backend shared the same
three-provision recipe; unit-test-prepush-tanstack and -nodejs-backend
shared the same single-provision recipe. Extract four recipe constants
(NODEJS_LINT_BUILD_RECIPE, JAVA_LINT_BUILD_RECIPE, NODEJS_UNIT_TEST_RECIPE,
JAVA_UNIT_TEST_RECIPE) so each option references the shared definition.

Test coverage:
- resolver.spec: add setup_notes merging test; register setupNoteWriter
  in the local test registry so the writer is exercised
- setup.spec: add test that verifies each note in logicalConfig.setup_notes
  is emitted via clack.log.info

https://claude.ai/code/session_013QWL9bW6TUvE8WWnrFWz5e
@mrsimpson
mrsimpson merged commit 66b27d7 into main Mar 18, 2026
1 check passed
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