Add backpressure facet with git hooks and setup-note provision writer - #4
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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, andjava-backend.available()predicate: options declare their own availability basedon resolved facet deps, keeping architecture-specific variants out of
core logic.
setup-noteprovision writer: a new writer (setup_notes: string[]on
LogicalConfig) lets any catalog option emit post-setup instructionsthrough the resolution pipeline. Replaces hardcoded arch-specific hints
in
setup.tswith a simple loop overlogicalConfig.setup_notes.NODEJS_LINT_BUILD_RECIPE,JAVA_LINT_BUILD_RECIPE,NODEJS_UNIT_TEST_RECIPE,JAVA_UNIT_TEST_RECIPEconstants eliminateduplicated inline recipes across the per-architecture options.
Test plan
pnpm -r testpasses (162 tests across core, harnesses, cli)pnpm -r buildsucceeds with no type errorsresolver.spec.ts— newsetup_notes mergingblock verifiessetup-noteprovisions populate the field end-to-endsetup.spec.ts— new test verifies each note inlogicalConfig.setup_notesis emitted via<clack.log.info>catalog.spec.ts— new test verifies alllint-build-precommit-*options carry a
setup-noteprovision with non-empty textregistry.spec.ts— updated to expect 8 built-in provision writersincluding
setup-note