feat(platform): add v0.2.0 project manifest platform#650
Conversation
📝 WalkthroughWalkthroughAdds project-manifest parsing and validation, a new ChangesManifest and HOLMES matrix rollout
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions workflow
participant CLI as wesley-cli
participant MP as wesley-core::project_manifest
participant HOLMES as holmes-investigate / watson-verify / moriarty-predict
participant PRC as packages/wesley-holmes/src/pr-comment-cli.mjs
participant PRM as packages/wesley-holmes/src/pr-comment.mjs
GH->>CLI: config changed-schemas --json
CLI->>MP: load_project_manifest / select_changed_schema_paths
MP-->>CLI: schema_sets, selected_count
GH->>HOLMES: matrix schema_set jobs
HOLMES-->>GH: reports-by-schema/<id>/ artifacts
GH->>PRC: comment-report with grouped report sets
PRC->>PRM: buildHolmesMultiSchemaComment
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 The Case of Pull Request #650Schema Sets
Schema Set
|
🚢 SHIPME[SHIPME] PASS · HOLMES fixture · sha 5d9f671 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1b3a5f7d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (2)
docs/build-artifacts.md (1)
5-13: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueClarify whether external targets write to
out/and.wesley-cache/.The updated descriptions suggest external targets produce artifacts in
.wesley-cache/andout/. If targets declare their ownoutputDirin the project manifest, theout/description may overgeneralize. Consider tightening to "Native emit commands or external targets that use the default output directory."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/build-artifacts.md` around lines 5 - 13, The `build-artifacts.md` table overgeneralizes `out/` and `.wesley-cache/` for external targets; update the descriptions so they only claim artifacts are written there when the target uses the default output location. Tighten the wording for the `out/` and `.wesley-cache/` rows to distinguish native emit commands from external targets with custom `outputDir` settings, keeping the entries aligned with how the artifact locations are actually produced.test/ci-workflows.bats (1)
190-215: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueVerify exact occurrence counts in workflow file.
The test asserts specific grep occurrence counts (4 for
schema_setmatrix, 6 forreports-by-schema). These counts are fragile if the workflow file structure changes. Consider whether these should be exact equality (-eq) or minimum thresholds (-ge) for maintainability, or add a comment explaining why these specific counts are expected.#!/bin/bash # Verify the actual occurrence counts in the workflow file grep -c 'schema_set: \${{ fromJson(needs.detect-schema-sets.outputs.schema_sets) }}' .github/workflows/wesley-holmes.yml grep -c 'reports-by-schema/\${{ matrix.schema_set.id }}' .github/workflows/wesley-holmes.yml grep -c 'steps.detect.outputs.selected_count' .github/workflows/wesley-holmes.yml🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/ci-workflows.bats` around lines 190 - 215, The workflow test in bats is asserting brittle exact grep counts for `schema_set` and `reports-by-schema` in `test/ci-workflows.bats`. Update the checks around `wesley-holmes.yml` to use more maintainable thresholds where appropriate, or add a clear inline comment explaining why the current exact counts in the `HOLMES workflow uses Wesley project manifest for selective schema sets` test are intentionally fixed. Keep the existing symbol references like `detect-schema-sets`, `schema_set`, and `steps.detect.outputs.selected_count` so the intent remains tied to the workflow structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/wesley-holmes.yml:
- Around line 61-77: The fallback in the workflow step around the `wesley config
inspect --json` check is too broad and currently treats malformed
`wesley.config.json` the same as a missing manifest. Update the conditional
handling in this job so `wesley config inspect` parse/validation failures stop
the workflow instead of entering the legacy schema-detection branch, and reserve
the fallback only for the manifest-absent case; keep the existing
`changed-schemas` and `wesley-selected.json` path for valid manifests.
- Around line 218-223: The artifact upload steps are saving the shared
reports-by-schema parent directory instead of each schema’s own folder, which
causes an extra path level on download. Update the three actions/upload-artifact
steps for holmes-report, watson-report, and moriarty-report to use the
schema-specific reports-by-schema/${{ matrix.schema_set.id }} path so the
extracted artifacts place each schema ID directly under the reports root. Use
the existing matrix.schema_set.id value and keep the upload naming unchanged.
In `@crates/wesley-cli/src/main.rs`:
- Around line 457-466: The changed-schemas branch in main is comparing raw
manifest entries against Git changed paths, so manifest-relative schemas can be
missed. Use the existing manifest_path from load_manifest_from_options() to
rebase or resolve schema paths before calling select_changed_schema_paths(),
reusing the same path resolution behavior as resolve_manifest_relative_path() so
ConfigChangedSchemasReport is built from normalized paths rather than unresolved
manifest-relative values.
In `@crates/wesley-core/src/domain/project_manifest.rs`:
- Around line 416-430: parse_manifest_value currently accepts the first YAML
document from YamlLoader::load_from_str and silently ignores any trailing
documents, so update this fallback to reject multi-document YAML manifests
explicitly. After loading, check the document count before using
documents.first(), and return a ProjectManifestError::Parse when more than one
document is present; keep the existing JSON/YAML error handling and yaml_to_json
path otherwise.
- Around line 493-500: The normalize_path helper is over-normalizing by
stripping leading slashes and collapsing "."/"./" into an empty path, which
breaks absolute and current-directory bundleDir values. Update normalize_path in
project_manifest.rs to preserve absolute paths unchanged and keep "."/"./" as a
valid current-directory base while still normalizing separators and redundant
internal segments; make sure the logic in normalize_path and any callers that
build bundle directories continue to work for multi-schema manifests.
In `@packages/wesley-holmes/src/pr-comment-cli.mjs`:
- Around line 16-38: The CLI currently derives schema sets only from
loadHolmesSuiteReportSets(), which misses any selected schemas that failed
before uploading artifacts. Update main and its call path to accept the selected
IDs from detect-schema-sets.outputs.schema_sets, then use those IDs to build the
aggregate comment so every expected schema appears. In particular, preserve the
existing buildHolmesMultiSchemaComment flow but synthesize placeholder sections
for schema IDs that are missing from reportSets, instead of inferring the list
solely from downloaded artifacts.
In `@test/domain-empty-boundary.bats`:
- Around line 120-122: The current test in the domain-empty-boundary Bats file
only checks a total grep count for descriptorOnly, which can still pass if one
fixture loses the field and another gains an extra match. Update the test to
inspect each fixture-extension.json individually in fixture-zoo, using the
existing test block around the grep/assert_success logic, so each
descriptor-only fixture is verified directly instead of relying on an aggregate
count.
---
Nitpick comments:
In `@docs/build-artifacts.md`:
- Around line 5-13: The `build-artifacts.md` table overgeneralizes `out/` and
`.wesley-cache/` for external targets; update the descriptions so they only
claim artifacts are written there when the target uses the default output
location. Tighten the wording for the `out/` and `.wesley-cache/` rows to
distinguish native emit commands from external targets with custom `outputDir`
settings, keeping the entries aligned with how the artifact locations are
actually produced.
In `@test/ci-workflows.bats`:
- Around line 190-215: The workflow test in bats is asserting brittle exact grep
counts for `schema_set` and `reports-by-schema` in `test/ci-workflows.bats`.
Update the checks around `wesley-holmes.yml` to use more maintainable thresholds
where appropriate, or add a clear inline comment explaining why the current
exact counts in the `HOLMES workflow uses Wesley project manifest for selective
schema sets` test are intentionally fixed. Keep the existing symbol references
like `detect-schema-sets`, `schema_set`, and
`steps.detect.outputs.selected_count` so the intent remains tied to the workflow
structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8bed5cd1-49f4-4ebe-b33f-061b0d6d1154
📒 Files selected for processing (33)
.github/workflows/wesley-holmes.ymlCHANGELOG.mdCONTRIBUTING.mdREADME.mdcrates/wesley-cli/src/main.rscrates/wesley-cli/tests/cli.rscrates/wesley-core/src/domain/mod.rscrates/wesley-core/src/domain/project_manifest.rscrates/wesley-core/src/lib.rscrates/wesley-core/tests/project_manifest.rsdocs/GUIDE.mddocs/README.mddocs/architecture/holmes-architecture.mddocs/architecture/holmes-integration.mddocs/build-artifacts.mddocs/guides/extending.mddocs/guides/generator-plugins.mddocs/guides/module-authoring.mddocs/guides/quick-start.mddocs/reference/cli.mddocs/reference/project-manifest.mddocs/truth-manifest.jsonpackages/wesley-holmes/src/cli.mjspackages/wesley-holmes/src/pr-comment-cli.mjspackages/wesley-holmes/src/pr-comment.mjspackages/wesley-holmes/test/pr-comment.test.mjstest/ci-workflows.batstest/domain-empty-boundary.batstest/fixtures/extensions/fixture-zoo/README.mdtest/fixtures/extensions/fixture-zoo/blade-heavy/fixture-extension.jsontest/fixtures/extensions/fixture-zoo/compiler-heavy/fixture-extension.jsontest/fixtures/extensions/fixture-zoo/evidence-heavy/fixture-extension.jsonwesley.config.json
docs/topics AuditI re-ran the manual
Validation:
Follow-up commit: |
docs/topics Coverage CorrectionCorrection to the earlier topic audit: auditing only the tracked Remediation commit: Added topic coverage:
Signposts updated:
Validation:
With this correction, |
|
@codex self-audit issue discovered during Code Lawyer pass:
|
|
Summary
Testing
|
Code Lawyer Activity Summary
Validation after fixes:
Domain-free invariant: preserved. This PR adds generic project structure, schema-set selection, and CI/report plumbing only; no downstream domain semantics were added to Wesley core. |
Linked Issue
N/A - this is the consolidation PR for the completed v0.2.0 platform batch. The implementation issues were closed with rationale comments before this PR was opened: #125, #138, #139, #231, #235, #574, #576, #585, and #64. Release gate #625 remains intentionally open until this PR lands on
mainand v0.2.0 is released from a signed tag.Branch / Issue-Title Check
v0.2.0/platform-batchis a release-batch branch, not a single issue-title slug.Summary
This PR lands the v0.2.0 platform batch as one reviewed unit after completing all 11/11 scheduled implementation slices.
It adds a domain-free Wesley project manifest layer (
wesley.project-manifest/v1) for schema-set discovery, changed-schema selection, target metadata, and bundle isolation. It also wires Holmes CI to use the manifest-driven schema-set matrix, updates the Holmes PR comment aggregation for schema-scoped reports, adds a descriptor-only fixture module zoo, and refreshes the public docs/onramp around project manifests and module authoring.Why
Wesley needs a deterministic, domain-free project boundary for multi-schema repositories without letting downstream semantics leak into core. The manifest gives Wesley enough structure to discover schema sets, select changed schemas, route output directories, and drive CI, while keeping renderers, runtimes, database targets, application semantics, and product-specific meaning outside Wesley.
The alternative was continuing to infer every workflow from ad hoc paths and legacy single-schema conventions. That kept CI brittle and made docs/operator behavior harder to verify.
Changes
wesley.project-manifest/v1JSON/YAML parsing, validation, and project metadata inwesley-core.wesley.config.jsonand manifest-driven Holmes schema-set matrix selection.Method Evidence
Tracker Hygiene
work-in-progresswhile active, or no single linked issue applies.Risk
Primary risk is CI/workflow behavior: Holmes now fans out by schema-set matrix and aggregates per-schema reports. Mitigation: workflow Bats tests pin schema-set propagation, artifact scoping, comment builder inputs, and release workflow invariants.
Secondary risk is manifest path handling. Mitigation: Rust tests cover manifest-relative schema paths, bundle roots, invalid IDs, multi-document YAML rejection, invalid manifest fallback refusal, and descriptor-only fixtures.
Domain-boundary risk was explicitly checked: this PR adds generic project structure and extension metadata only. Wesley remains GraphQL structure -> deterministic/extensible IR; downstream extensions own semantics.
Backout
Revert the merge commit before cutting v0.2.0. Keep #625 open, do not tag, and rerun
pnpm run preflightplus workflow-focused Bats before attempting a replacement PR.Testing
pnpm run preflightcargo test -p wesley-cli --test clicargo test -p wesley-core --test project_manifestnode --test packages/wesley-holmes/test/pr-comment.test.mjsBATS_LIB_PATH=test/vendor bats -t test/ci-workflows.batsBATS_LIB_PATH=test/vendor bats -t test/domain-empty-boundary.batscargo xtask docs-checknode scripts/check-doc-cli-commands.mjspnpm lintgit diff --checkEvidenceMap / SourceMap (if applicable)
N/A - this PR changes Wesley project/CI metadata and fixture/docs coverage, not SQL-to-SDL EvidenceMap output.
Screenshots / Logs (optional)
N/A.
Merge Strategy
Checklist
cargo xtask preflight, viapnpm run preflight).cargo xtask legacy-preflight, viapnpm run preflight).