Skip to content

fix: address 14 analysis and governance review bugs (#48–#61) - #65

Merged
aoto-tech merged 12 commits into
mainfrom
fix/review-bugs-48-61
Sep 7, 2026
Merged

fix: address 14 analysis and governance review bugs (#48–#61)#65
aoto-tech merged 12 commits into
mainfrom
fix/review-bugs-48-61

Conversation

@aoto-tech

@aoto-tech aoto-tech commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Boundary analysis could return success after dropping relevant declarations, loader origins, URL authorities, or resource candidates. Other review findings showed inconsistent ownership, coverage counts, Python resolution, and baseline adoption guidance.

This PR fixes the 14 reviewed cases and adds executable regressions. It remains a draft while the full PR CI, including changed-scope mutation testing and the platform matrix, completes on the latest head.

Issue Change
#48 Remove exact @internal declaration spans so adjacent public signatures remain in the hash.
#49 Carry the actual createRequire origin through aliases and call/apply forms; unresolved origins fail closed.
#50 Resolve both URL input and base, retaining the destination authority.
#51 Treat more than 16 unique static alternatives as unresolved instead of silently dropping candidates.
#52 Remove unsound resource scan prefilters and cover the Fastify route method vocabulary.
#53 Analyze an explicit head commit in a detached temporary worktree; preserve the caller's checkout and dirt.
#54 Prefer Python packages over same-named modules, checked against Python's runtime.
#55 Report assigned or escaped require loaders as unsupported analysis.
#56 Use owned-path overlap semantics for cell-versus-path reservations.
#57 Apply bare-directory ownership to blast radius, including deleted paths and commit evidence.
#58 Apply governance exclusions to coverage inventory and preserve cell/line attribution.
#59 Document passing resource contracts as a prerequisite for baseline creation.
#60 Read standard-library names from the inspector's isolated Python runtime.
#61 Always compare declared Changed-Cells with actual changed ownership, including empty declarations.

Latest repair — 2026-09-08 JST

Commit ae7ff86e91104210d7dc9e897a60ad997a6c1005 integrates main at ede709489d4930339d7f8740e7f011e4708481a4 and addresses the remaining module-resolution mutation gaps.

  • Remove redundant loader-binding recognition and the unused default-binding path without weakening unresolved-loader diagnostics.
  • Exercise internal-declaration span removal through actual .ts, .mts, and .cts declaration emission; retain the existing declaration-file regression.
  • Assert the complete assigned/escaped-loader diagnostics and the kind/typeOnly metadata of imports resolved from a different createRequire origin.
  • Cover ordinary shadowed functions and properties, builtin loader forms, and invalid file URLs.
  • Resolve the Python stdlib merge conflict by retaining isolated runtime discovery, which already includes main's tomllib and types additions. Main's regression tests are included and pass.

Verification at the latest repair commit

The isolated verification run checked out and tested the detached commit ae7ff86e91104210d7dc9e897a60ad997a6c1005 before it was fast-forwarded onto this PR. The temporary verification workflow and helper are not part of this PR's tree.

Check Result
npm test, including build, on Ubuntu / Node 20 / Python 3.12 1,196 passed, 1 skipped, 0 failed. The skipped test requires Windows cmd.exe.
npm run lint Passed.
npm run typecheck Passed.
npm run cellfence:self-check Passed against the unchanged signed baseline.
git diff --check and clean tracked working-tree verification Passed.
Focused, non-incremental Stryker verification 115 killed, 0 timed out, 0 survived; 100.00%, with the existing break threshold of 100.

The focused mutation result covers requireOrigin, requireBindingForExpression, addUnsupportedRequireWarning, addRequireCallReference, and sourceTextWithoutInternalDeclarations. It is not a whole-module or repository-wide mutation score.

The full PR CI rerun was started on the updated PR head. Its changed-scope mutation result and complete OS/Node matrix were still pending when this verification note was written; the focused result above does not replace those checks.

Regression checks also exercise Node/Python runtime resolution, URL authority, the 16/17 candidate boundary, caller worktree preservation, claims, coverage exclusions, dependency ratchets, and empty Changed-Cells.

Public-surface compatibility

The import origin is internal analysis metadata, and the hashing helper is internal to the module. Keeping those implementation details out of the public declarations resolved the initial signature mismatch. The accepted signed baseline, signing key, verification policy, fixture outcomes, and mutation thresholds remain unchanged; baseline migration is not required by the current self-check.

Python 3.10+ supplies complete stdlib metadata; older runtimes without it recognize builtin modules conservatively. Resource candidate overflow and unsupported loader flow produce unresolved findings instead of a partial success.

Closes #48
Closes #49
Closes #50
Closes #51
Closes #52
Closes #53
Closes #54
Closes #55
Closes #56
Closes #57
Closes #58
Closes #59
Closes #60
Closes #61

Problem:
Boundary checks could miss public API changes, loader origins, URL authorities, overflowed alternatives and supported routes. Ownership, coverage and Python dependency reporting could disagree with runtime behavior.

Change:
Fix the fourteen reviewed cases (#48#61), add regression tests with Node and Python oracles, and correct baseline adoption documentation.

Behavior:
Known references resolve from their actual origin; unsupported loader flow and incomplete resource analysis fail closed. Explicit head refs analyze committed snapshots. Ownership and coverage use consistent exclusions and directory semantics.

Tests:
Full test suite: 1,182 passed, 2 skipped, 0 failed. Build, lint and typecheck passed. Scoped mutation is running.

Known-Gaps:
Self-check requires review and re-signing of the accepted engine baseline after correcting public API hashing. The signed baseline and verification policy are preserved. Mutation verification is pending.

Change-Type: implementation
Changed-Cells: cli,engine,plugin-blast-radius
Tests-Added: tests/bug-fixtures.mjs
Tests-Modified: tests/module-resolution.test.mjs,tests/official-plugins.test.mjs,tests/resource-access-coverage.test.mjs,tests/review-regressions.test.mjs
Test-Impact: Regression tests cover all fourteen reviewed cases with runtime resolution oracles where applicable.
Tests-Not-Added-Reason: Regression tests were added for all reviewed cases.
Agent-Run-Id: cellfence-review-fixes-2026-09-06
Agent-Task-Id: fix-review-bugs-48-61
@aoto-tech

Copy link
Copy Markdown
Owner Author

@pushnanashi2 Leaving this draft unmerged for now. It is behind main and not currently closeable: self-check, cross-platform smoke (windows-latest, node 22), and ci-counts failed on the latest run, and mutation evidence was still incomplete at review time. GitHub does not allow me to submit a Changes requested review on my own PR, so I am recording the blocker here instead.

aoto-tech and others added 11 commits September 7, 2026 02:21
Problem:
Resource mutation checks exposed untested malformed URL combinations and candidate-product overflow. Loader regression coverage needed direct factory, bound alias and exact fail-closed diagnostics.

Change:
Remove the redundant URL argument fallback and add focused regression cases for URL failures and loader origins, preserving concurrent regression fixes.

Behavior:
Malformed or overflowing URL alternatives cannot produce a partially approved result. Supported loader origins remain precise and unsupported loader flows report stable diagnostics.

Tests:
The latest 131 targeted tests, build and signed-baseline self-check pass. Resource-access mutation scored 100% in a forced full scope run. Module-resolution mutation is still running.

Known-Gaps:
The remaining module-resolution mutation result and latest cross-platform CI are pending.

Change-Type: implementation
Changed-Cells: engine
Tests-Added: none
Tests-Modified: tests/module-resolution.test.mjs,tests/resource-access-coverage.test.mjs
Test-Impact: Cover malformed URL alternatives, URL Cartesian overflow, direct createRequire calls, bound aliases, and exact unsupported-loader diagnostics.
Tests-Not-Added-Reason: Existing regression suites were extended.
Agent-Run-Id: cellfence-review-fixes-2026-09-06
Agent-Task-Id: fix-review-bugs-48-61
Problem:
Mutation probes found gaps around non-URL import metadata, new.target, unknown URL inputs or bases, and declaration tokens adjacent to removed internal declarations.

Change:
Add focused origin and declaration regressions. Simplify missing URL arguments and redundant catch returns without changing unresolved behavior.

Behavior:
Only supported file origins resolve. Removing an internal declaration preserves the whitespace needed to separate adjacent public type tokens.

Tests:
All 131 targeted tests, build, lint and signed-baseline self-check passed after this change. Six previously surviving injected mutations are detected by the strengthened tests. Twelve selected authoritative mutation scopes passed at 100%; final module-resolution mutation and latest CI remain pending.

Known-Gaps:
The PR stays in draft until final mutation and CI validation complete. No repository-wide mutation score is claimed.

Change-Type: implementation
Changed-Cells: engine
Tests-Added: none
Tests-Modified: tests/module-resolution.test.mjs
Test-Impact: Cover exact adjacent declaration output and unsupported origin expressions, and verify six injected regressions are rejected.
Tests-Not-Added-Reason: Existing regression tests were extended.
Agent-Run-Id: cellfence-review-fixes-2026-09-06
Agent-Task-Id: fix-review-bugs-48-61
@aoto-tech
aoto-tech marked this pull request as ready for review September 7, 2026 23:42
@aoto-tech
aoto-tech merged commit 1a88d50 into main Sep 7, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment