Skip to content

fix: complete reports integration across extension push, pull, and search#792

Merged
stack72 merged 1 commit intomainfrom
fix/reports-extension-integration
Mar 20, 2026
Merged

fix: complete reports integration across extension push, pull, and search#792
stack72 merged 1 commit intomainfrom
fix/reports-extension-integration

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented Mar 20, 2026

Summary

PR #790 added reports as a top-level extension primitive, but several extension system paths were not updated to handle them consistently with other extension types. This PR fixes bugs and consistency gaps across push, pull, and search.

Bug fixes

  • Report bundles compiled without bundleOptions — Reports using bare specifiers or deno.json import maps would fail to compile during extension push because bundleOptions (denoConfigPath/packageJsonDir) was not passed to bundleExtension(). All other extension types correctly received these options.
  • Reports excluded from bare specifier detection — When determining whether a package.json is needed for bundling, report entry points were not checked. If a report was the only file using bare specifiers, packageJsonDir would never be set, causing a bundling failure.
  • validateSourceCompleteness skipped reports on pull — After pulling an extension, source completeness validation checked models, vaults, drivers, and datastores but not reports. Missing report dependencies would go unwarned.
  • --content-type reports rejected by CLI — The extension search command had a hardcoded content type validation list that didn't include "reports", so swamp extension search --content-type reports would error.

Consistency fixes

  • Manifest validation error message now includes "report" as a valid extension type
  • Collective validation error messages and docstrings now mention reports
  • Content metadata debug log now includes report count
  • Help text for --content-type flag lists reports

Test plan

  • deno run test src/domain/extensions/extension_manifest_test.ts — passes with updated error message
  • deno run test src/domain/extensions/extension_collective_validator_test.ts — passes
  • deno run test src/domain/extensions/extension_content_extractor_test.ts — passes
  • deno check on all modified files — clean

🤖 Generated with Claude Code

…arch

Reports were added as a top-level primitive in #790, but several extension
system paths were not updated to handle them consistently with other
extension types (models, vaults, drivers, datastores).

Bug fixes:
- Report bundles were compiled without bundleOptions (denoConfigPath/
  packageJsonDir), causing reports using bare specifiers or import maps
  to fail during `extension push`
- Report entry points were excluded from the bare specifier detection
  that determines whether package.json resolution is needed
- `validateSourceCompleteness` in extension pull skipped the reports
  directory, so missing report dependencies went unwarned
- `extension search --content-type reports` was rejected by the CLI's
  hardcoded content type validation list

Consistency fixes:
- Manifest validation error message now includes "report" as a valid
  extension type
- Collective validation error messages and docstrings now mention reports
- Content metadata debug log now includes report count

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial Review

Critical / High

None.

Medium

None.

Low

  1. extension_pull.ts:596validateSourceCompleteness uses first dir as boundary: The function uses dirs[0] (models dir) as the import resolution boundary regardless of which dir the entry point came from. If a report imports a sibling file via relative path, the boundary check resolves against the models directory, not the reports directory. This is a pre-existing issue not introduced by this PR, and the function's catch on Deno.stat failure gracefully handles any resulting false positives by reporting them as warnings rather than errors.

Verdict

PASS — This is a clean bug-fix PR. The four logic changes are correct: (1) bundleOptions now passed to report bundling matching all other extension types, (2) report entry points included in bare specifier detection, (3) validateSourceCompleteness now receives the reports directory via the existing rest parameter, and (4) "reports" added to the search content type validation list. All message/docstring updates are consistent. No new logic paths are introduced that could fail.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Approve ✅

Clean, focused bug fix PR that completes the reports integration across the extension system. All changes are consistent and correct.

What I verified

  • bundleExtension fix (extension_push.ts:581): Report bundles now correctly receive bundleOptions (denoConfigPath/packageJsonDir), matching the pattern used by all other extension types (models, vaults, drivers, datastores).
  • Bare specifier detection (extension_push.ts:240): reportEntryPoints correctly added to the allEntryPoints array so report files with bare specifiers trigger packageJsonDir resolution.
  • validateSourceCompleteness (extension_pull.ts:948): Uses rest params (...dirs: string[]), so adding absoluteReportsDir is type-safe and correct.
  • Content type validation (extension_search.ts:116): "reports" added to validContentTypes array and help text.
  • Manifest error message (extension_manifest.ts:67): Updated to include "report" in the validation message.
  • Import boundaries: No libswamp boundary violations — all changes are in CLI commands or domain internals, importing correctly.
  • DDD alignment: Domain layer (ExtractedReport, ExtensionContentMetadata, CollectiveMismatch) already modeled reports correctly. This PR fixes the CLI/application layer wiring to use that domain logic consistently.
  • Test coverage: Manifest test and integration test assertions updated to match new error messages. The existing test suite for collective validator and content extractor already covers reports.

Suggestions (non-blocking)

None — this is a minimal, well-scoped fix with appropriate test updates.

🤖 Generated with Claude Code

@stack72 stack72 merged commit fc2dabf into main Mar 20, 2026
7 checks passed
@stack72 stack72 deleted the fix/reports-extension-integration branch March 20, 2026 17:07
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