Skip to content

Commit ef3a076

Browse files
authored
Merge pull request #138 from nold-ai/dev
Release: bundle_dependencies, pip_dependencies, and manifest validation (dev → main)
2 parents 416e61c + b48ae35 commit ef3a076

42 files changed

Lines changed: 551 additions & 57 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/adapters/azuredevops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ adapter = AdoAdapter(
187187

188188
### Error diagnostics (PATCH failures)
189189

190-
When a work item PATCH fails (e.g. HTTP 400 during backlog refine or status update), the CLI shows the ADO error message and a hint in the console. With `--debug`, the log includes the ADO response snippet and the JSON Patch paths attempted so you can identify the failing field. See [Debug Logging – Examining ADO API Errors](../reference/debug-logging.md#examining-ado-api-errors) and [Troubleshooting – Backlog refine or work item PATCH fails (400/422)](../guides/troubleshooting.md#backlog-refine-or-work-item-patch-fails-400422).
190+
When a work item PATCH fails (e.g. HTTP 400 during backlog refine or status update), the CLI shows the ADO error message and a hint in the console. With `--debug`, the log includes the ADO response snippet and the JSON Patch paths attempted so you can identify the failing field. See [Debug Logging – Examining ADO API Errors](https://docs.specfact.io/core-cli/debug-logging/#examining-ado-api-errors) and [Troubleshooting – Backlog refine or work item PATCH fails (400/422)](../guides/troubleshooting.md#backlog-refine-or-work-item-patch-fails-400422).
191191

192192
## Usage Examples
193193

docs/bundles/code-review/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Use it together with the [Codebase](../codebase/overview/) bundle (`import`, `an
1616

1717
## Prerequisites
1818

19-
- `specfact module install nold-ai/specfact-code-review`
19+
- `specfact module install nold-ai/specfact-code-review` — the manifest `bundle_dependencies` list includes **`nold-ai/specfact-codebase`**, so SpecFact CLI **will automatically install** the Codebase bundle alongside this one for the full shared **`specfact code`** command surface (import, analyze, drift, and related commands live there).
2020
- Optional tool installs (Ruff, Radon, Semgrep, Pyright, etc.) as described in command help
2121

2222
## `specfact code review` — nested commands

docs/guides/agile-scrum-workflows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,5 +1046,5 @@ If template rendering fails:
10461046
## Related Documentation
10471047

10481048
- [Command Reference - Project Commands](../reference/commands.md#project---project-bundle-management) - Complete command documentation including `project merge` and `project resolve-conflict`
1049-
- [Project Bundle Structure](../reference/directory-structure.md) - Project bundle organization
1049+
- [Project Bundle Structure](https://docs.specfact.io/reference/directory-structure/) - Project bundle organization (core CLI docs)
10501050
- See [Project Commands](../reference/commands.md#project---project-bundle-management) for template customization options

docs/reference/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Complete technical reference for the official modules site and bundle-owned work
1919
- **[Command Syntax Policy](command-syntax-policy.md)** - Source-of-truth argument syntax conventions for docs
2020
- **[Authentication](authentication.md)** - Device code auth flows and token storage
2121
- **[Architecture](architecture.md)** - Technical design, module structure, and internals
22-
- **[Debug Logging](debug-logging.md)** - Where and what is logged when using `--debug`
22+
- **[Debug Logging](https://docs.specfact.io/core-cli/debug-logging/)** - Where and what is logged when using `--debug` (core CLI docs)
2323
- **[Operational Modes](modes.md)** - CI/CD vs CoPilot modes
2424
- **[Specmatic API](specmatic.md)** - Specmatic integration API reference (functions, classes, integration points)
2525
- **[Telemetry](telemetry.md)** - Opt-in analytics and privacy guarantees
26-
- **[Feature Keys](feature-keys.md)** - Key normalization and formats
27-
- **[Directory Structure](directory-structure.md)** - Project structure and organization
26+
- **[Feature Keys](https://docs.specfact.io/reference/feature-keys/)** - Key normalization and formats (core CLI docs)
27+
- **[Directory Structure](https://docs.specfact.io/reference/directory-structure/)** - Project structure and organization (core CLI docs)
2828
- **[Schema Versioning](schema-versioning.md)** - Bundle schema versions and backward compatibility (v1.0, v1.1)
2929
- **[Module Security](module-security.md)** - Marketplace/module integrity and publisher metadata
3030
- **[Module Categories](module-categories.md)** - Category grouping model, canonical module assignments, bundles, and first-run profiles

docs/reference/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ Formal ADR pages are not yet published on the modules docs site. The current arc
161161

162162
## Related Docs
163163

164-
- [Directory Structure](directory-structure.md)
164+
- [Directory Structure](https://docs.specfact.io/reference/directory-structure/) (core CLI docs)
165165
- [Module Development Guide](/authoring/module-development/)
166166
- [Adapter Development Guide](/authoring/adapter-development/)

docs/reference/schema-versioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ schema_metadata:
178178

179179
- [Architecture - Change Tracking Models](../reference/architecture.md#change-tracking-models-v11-schema) - Technical details
180180
- [Architecture - Bridge Adapter Interface](../reference/architecture.md#bridge-adapter-interface) - Adapter implementation guide
181-
- [Directory Structure](directory-structure.md) - Bundle file organization
181+
- [Directory Structure](https://docs.specfact.io/reference/directory-structure/) - Bundle file organization (core CLI docs)

openspec/CHANGE_ORDER.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,9 @@ Adds bidirectional conversion between spec-kit feature folders and OpenSpec chan
7272
| speckit | 03 | speckit-03-change-proposal-bridge | [#116](https://github.com/nold-ai/specfact-cli-modules/issues/116) | specfact-cli/speckit-02-v04-adapter-alignment ([specfact-cli#453](https://github.com/nold-ai/specfact-cli/issues/453)) |
7373

7474
**Cross-repo dependency**: Requires `speckit-02-v04-adapter-alignment` in `nold-ai/specfact-cli` to be implemented first (provides `ToolCapabilities.extension_commands` consumed by `SpecKitBacklogSync`).
75+
76+
### Module bundle peer dependencies
77+
78+
| Module | Order | Change folder | GitHub # | Blocked by |
79+
|--------|-------|---------------|----------|------------|
80+
| peer-deps | 01 | module-bundle-deps-auto-install | [#135](https://github.com/nold-ai/specfact-cli-modules/issues/135) ||
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-04-02
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# TDD evidence — module-bundle-deps-auto-install
2+
3+
## Tests
4+
5+
- Added `tests/unit/test_registry_manifest_bundle_dependencies.py`:
6+
- `test_registry_bundle_dependencies_match_manifests` — every registry module with a local `module-package.yaml` must have matching `bundle_dependencies`.
7+
- `test_official_bundle_dependency_graph_is_acyclic` — no cycles among `nold-ai/*` edges in `registry/index.json`.
8+
- Ran: `.venv/bin/pytest tests/unit/test_registry_manifest_bundle_dependencies.py`**pass** (2 tests).
9+
- Ran: `.venv/bin/pytest tests/unit/docs/test_bundle_overview_cli_examples.py`**pass** (after overview doc update).
10+
11+
## Implementation
12+
13+
- `packages/specfact-code-review/module-package.yaml`: `bundle_dependencies` includes `nold-ai/specfact-codebase`; version **0.46.0** (minor bump per design).
14+
- `registry/index.json` + `registry/modules/specfact-code-review-0.46.0.tar.gz` (+ `.sha256`) aligned with publish workflow layout.
15+
- `docs/bundles/code-review/overview.md`: prerequisites note peer dependency / auto-install behavior.
16+
17+
## Signing (required before CI merge)
18+
19+
Manifest integrity was generated with **`hatch run sign-modules -- --allow-unsigned`** (checksum only) because the local signing key is encrypted and no passphrase was available in this environment.
20+
21+
**Before opening the PR or merging**, sign with the org private key so CI passes `verify-modules-signature --require-signature`:
22+
23+
```bash
24+
hatch run sign-modules -- \
25+
--key-file "${SPECFACT_MODULE_PRIVATE_SIGN_KEY_FILE:-$HOME/.specfact/sign-keys/module-signing-private.pem}" \
26+
packages/specfact-code-review/module-package.yaml \
27+
--payload-from-filesystem
28+
```
29+
30+
Then re-run:
31+
32+
```bash
33+
hatch run verify-modules-signature -- --require-signature --payload-from-filesystem
34+
```
35+
36+
If the manifest checksum changes after signing, rebuild the registry tarball and refresh `registry/index.json` checksum for `specfact-code-review-0.46.0.tar.gz` (same Python step as publish workflow) or re-run the publish automation.
37+
38+
## Quality gates (2026-04-02, worktree)
39+
40+
- `hatch run format` — pass
41+
- `hatch run yaml-lint` — pass
42+
- `hatch run type-check` (scoped + full lint path) — pass via `hatch run lint`
43+
- `hatch run lint` — pass
44+
- `python scripts/verify-modules-signature.py --payload-from-filesystem` — pass (all 6 manifests)
45+
- `python scripts/verify-modules-signature.py --require-signature --payload-from-filesystem`**fails until manifest is signed** (expected until signing step above)
46+
- `hatch run contract-test` — pass
47+
- `hatch run smart-test` — pass
48+
- `hatch run test` — pass
49+
- `hatch run specfact code review run --json --out .specfact/code-review.json --scope changed` — not run (SpecFact CLI: `Command 'code' is not installed`); complete before PR per `tasks.md` 4.3.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Context
2+
3+
Official bundles ship `module-package.yaml` with `commands` and optional `bundle_dependencies`. The registry copies `bundle_dependencies` into `registry/index.json` during publish (`publish-modules.yml`). `nold-ai/specfact-codebase` already depends on `nold-ai/specfact-project`; `nold-ai/specfact-code-review` shares the `code` command group but lists no peer dependencies, so installs can omit the codebase bundle until users discover missing `code` subcommands manually.
4+
5+
## Goals / Non-Goals
6+
7+
**Goals:**
8+
9+
- Declare `bundle_dependencies` for code-review so manifest and registry advertise the need for the codebase bundle (and, transitively via codebase, project).
10+
- Keep manifest and registry `bundle_dependencies` fields aligned after version bump and publish.
11+
- Add automated checks or tests that prevent drift between YAML manifest and JSON registry for this metadata where practical.
12+
13+
**Non-Goals:**
14+
15+
- Changing SpecFact CLI marketplace installer logic in this repo (core lives in `specfact-cli`); transitive `bundle_dependencies` behavior is confirmed in core (see “Resolved” below).
16+
- Re-evaluating every bundle’s full dependency graph beyond the known code-review gap (optional follow-up audits).
17+
18+
## Decisions
19+
20+
1. **Dependency list for code-review** — Add a single entry `nold-ai/specfact-codebase`. Rationale: codebase already depends on project; duplicating project on code-review would be redundant unless CLI only installs direct deps. If CLI resolves transitive `bundle_dependencies`, one entry is sufficient. If not, extend to also list `nold-ai/specfact-project` after verifying core behavior.
21+
2. **Semver** — Treat as **minor** if users perceive new auto-install behavior; **patch** if manifest/registry alignment only. Default to minor when `bundle_dependencies` changes user-facing install resolution.
22+
3. **Verification** — Prefer extending existing registry/manifest tests or `verify-modules-signature` expectations over one-off scripts.
23+
24+
## Risks / Trade-offs
25+
26+
- **Circular dependency** — Code-review must not create a cycle. Codebase does not depend on code-review → safe.
27+
- **Larger install footprint** — Users installing only code-review will pull more bundles; acceptable per goal of “full command group.”
28+
- **Core vs modules** — If CLI ignores `bundle_dependencies`, this change still documents intent; follow-up in specfact-cli.
29+
30+
## Migration Plan
31+
32+
1. Implement on a feature branch from `dev`; bump `specfact-code-review` version; update manifest + registry.
33+
2. Run publish/sign verification locally; publish via normal workflow.
34+
3. No data migration for end users beyond reinstalling or updating modules.
35+
36+
## Resolved: transitive `bundle_dependencies` installs
37+
38+
**Confirmed.** Marketplace installs recurse through `bundle_dependencies`: `_install_bundle_dependencies_for_module` in `specfact-cli` (`src/specfact_cli/registry/module_installer.py`) calls `install_module()` for each missing peer before placing the requested module, so transitive peers (e.g. codebase → project) are installed in order.
39+
40+
**Spec evidence:** `specfact-cli` `openspec/specs/official-bundle-tier/spec.md` — requirement **“Module installer auto-installs bundle dependencies for official-tier bundles”** (installer SHALL automatically install listed dependencies when an official bundle declares `bundle_dependencies`).
41+
42+
**This change’s delta spec:** `openspec/changes/module-bundle-deps-auto-install/specs/module-bundle-dependencies/spec.md` — manifest/registry parity and acyclicity for declared peers.

0 commit comments

Comments
 (0)