Skip to content

fix: ignore untracked manifests during dependency preparation - #304

Merged
datacas merged 1 commit into
mainfrom
task-303
Oct 22, 2026
Merged

datacas merged 1 commit into
mainfrom
task-303

Conversation

@datacas

@datacas datacas commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Summary

manifests() now uses Git's tracked-file list, so ignored or untracked generated package.json files do not enter dependency planning, fingerprinting, staging, completeness checks, or lifecycle-build detection. A preparation-level regression test covers an ignored .output/server/package.json with dependencies.

Work item: #303

Routing: profile cheap_coder, requested model openai/gpt-6-luna, effort high, resolved model ?.

Diagnosis

The reported symptom reproduced: an ignored .output/server/package.json with a non-empty dependencies map made preparation return incomplete with frozen install returned success without required dependency outputs. Reproduction command: rtk python3 /tmp/code-cycle-tmp-l9_r8s5k/repro.py.

The issue's hypothesis was confirmed. manifests() walked the filesystem without checking Git tracking, so generated manifests became package inputs and prepare() required their nonexistent install outputs. The broken invariant was that only Git-tracked manifests define source packages. Fixing manifest discovery restores that invariant at the shared input boundary.

The widened search covered dependency preparation, package.json, the reported error, and scripts/dependency_setup.py; it found related historical work item #279 and merged PR #287, which introduced frozen Node dependency preparation but did not settle this ignored-manifest case. No other open work item was found.

Work units

Unit Behaviour Files Tests Verification Rollback
WU-1 Exclude generated manifests from dependency preparation scripts/dependency_setup.py, tests/test_dependency_setup.py SetupTests.test_ignored_generated_manifest_does_not_block_preparation python3 -m unittest discover -s tests (1,691 passed); python3 scripts/validate-package.py (passed); python3 -m unittest (0 discovered); basedpyright reported diagnostics, as detailed below Independent: revert commit 4ba0dc982a40bedd99b66710800f54e8ab650da3

Verification

Level Command Exit Result
test python3 -m unittest discover -s tests 0 1,691 tests passed
static python3 scripts/validate-package.py 0 16 skills validated; shared sections and manifests aligned
test python3 -m unittest 0 0 tests discovered
static basedpyright scripts/dependency_setup.py tests/test_dependency_setup.py 1 29 errors and 609 warnings across the files; no error on the changed function or regression method; no baseline comparison
static git diff --check 0 clean

The test fixtures use temporary Git repositories and a mocked package-manager runner. They do not establish real sandbox confinement. The configured CI policy is parallel; checks for the pushed head are reported separately by the implementation stage.

Commit: 4ba0dc982a40bedd99b66710800f54e8ab650da3

@datacas

datacas commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Implemented #303 in commit 4ba0dc982a40bedd99b66710800f54e8ab650da3. Dependency preparation now considers Git-tracked package.json files only, and the regression test confirms an ignored generated .output/server/package.json no longer blocks preparation or enters the staged tree.

Local verification: python3 -m unittest discover -s tests passed (1,691 tests); python3 scripts/validate-package.py passed; python3 -m unittest exited 0 but discovered 0 tests. basedpyright scripts/dependency_setup.py tests/test_dependency_setup.py exited 1 with 29 errors and 609 warnings; no error was reported on the changed function or regression method, and no baseline comparison was run.

Checks for head 4ba0dc982a40bedd99b66710800f54e8ab650da3: 0 passed, 0 failed, 5 pending (queued/running): Skills, manifests, and Bash installer; Windows test shard (windows-1); Windows test shard (windows-2); Windows test shard (windows-3); Windows test shard (windows-4).

@datacas

datacas commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261022-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:2

Initial review of PR #304 (work item #303)

Status: REVIEW_PASSED_AWAITING_CI. Head 4ba0dc982a40bedd99b66710800f54e8ab650da3 was fully reviewed; no open finding blocks approval. This is not an approval: the CI gate decides once the checks finish (CI policy: parallel).

Reviewed scope

Accumulated diff origin/main...HEAD (merge base 4d45a2893272e80c9632ab5f104ecfc3d837db3c, 60 lines, 2 files): scripts/dependency_setup.py and tests/test_dependency_setup.py. Applied project convention: AGENTS.md (tool routing only; no project-specific review rules).

manifests() now lists git ls-files -z --cached under the project directory instead of walking the filesystem, so ignored or untracked generated package.json files (for example .output/server/package.json) no longer enter planning, fingerprinting, staging, or the completeness check. prepare() already stages from the same tracked list (names), so manifest discovery and staging now agree. A non-zero git ls-files exit raises ValueError instead of silently returning no manifests.

Findings

None.

Security triage

No security_review.always_when rule is configured, so the built-in defaults apply. The rule does not fire on changed paths or labels (none). My own reading flagged the dependency-preparation surface, so I audited it inline; the delegated cc-security-review skill was not run (degraded pass). Result: no vulnerability. The change only narrows what is installed (tracked manifests only). git runs with an argv list and no shell, a 30 s timeout, and cwd fixed to the project; returned paths are repository-relative and joined onto root; output-path escape checks in prepare() are unchanged.

Commands executed (all exit 0)

Command Result
python3 -m unittest tests.test_dependency_setup 28 tests passed, including test_ignored_generated_manifest_does_not_block_preparation
python3 -m unittest discover -s tests 1691 tests passed
python3 scripts/validate-package.py VALID: 16 skills, shared sections in sync, manifests aligned
python3 -m unittest 0 tests discovered (the suite lives under tests/)

I did not run the new test against the base code to confirm it fails there. The PR author reports reproducing the original failure.

Unverified

  • Real npm/srt installs: the tests use temporary Git repositories and a mocked runner, as the PR states. The runtime preparation evidence for this head reports prepared for an npm project.
  • Windows behaviour of the new git ls-files path handling relies on the Windows shards in CI.

CI (head 4ba0dc9, read once, not awaited)

All Validate package checks are IN_PROGRESS: Skills, manifests, and Bash installer, Windows test shard (windows-1), (windows-2), (windows-3), (windows-4). Passed: 0, failed: 0, pending: 5.

Residual risks

  • Behaviour change: a new, not-yet-git added package.json is no longer prepared. It is consistent with staging, which already used tracked files only.
  • projects() still discovers lock roots by walking the filesystem. An ignored generated directory holding both package.json and a lockfile would still become a plan, now with an empty manifest list. This is outside the reported symptom and not covered by a test. It is not a finding.

Verdict

No blocking findings on the reviewed head. Awaiting the 5 pending checks.

@datacas
datacas merged commit bf0e31e into main Oct 22, 2026
6 checks passed
@datacas
datacas deleted the task-303 branch October 26, 2026 09:32
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