Skip to content

fix(push): stop scoped pushes before creating unlinked dependencies - #108

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1795226877-scoped-dep-gate
Open

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1795226877-scoped-dep-gate

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This closes the last gap after #104: a push scoped to one file no longer creates an unlinked dependency without an explicit flag.

Before: npm run push -- acme resources/acme/assistants/receptionist.md auto-applied an unlinked tools/my-end-call.yml. The new-file check only looked at the paths given, so the push POSTed a new tool, even when the org already had a same-named one, and warned only afterwards.

Now the preflight walks the dependencies the scoped push would auto-apply (src/push-dependencies.ts), including squad → assistant → tool/structured output. Each unlinked one goes into the same grouped stop report (text and --json) with "Needed by " and the usual fixes: --adopt <id>, --allow-new-files, or delete. The push exits 1 before any write.

  • --allow-new-files approves creation across the selected scope and its dependencies; dependency paths don't need to be listed.
  • Dependencies that are already linked, or reusable because the repo pushed or adopted them, behave as before.
  • The scope selection logic moved to src/push-scope.ts so the preflight and the push share it.

Example (scoped push, same-named org tool exists):

Push stopped: review 1 file(s) for acme. Exit code: 1.
  Not linked to any resource in acme yet. Needed by resources/acme/assistants/receptionist.md. Same-named resource(s): 67aea057-…; NOT linked automatically.
  Command: npm run push -- acme --adopt my-end-call resources/acme/assistants/receptionist.md OR npm run push -- acme --allow-new-files resources/acme/assistants/receptionist.md OR rm -- resources/acme/tools/my-end-call.yml

Docs: AGENTS.md (new-file check), README, commands/how-it-works guides, improvements.md.

Tests: npm run build, npm test (614 pass), and Biome pass. Local-HTTP integration tests cover these cases: blocked with no non-GET requests, approved, adopted, linked, owned reuse, transitive, dry run, JSON, and inventory error. No live org was touched.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin Review

🟢 Devin Review found nothing to fix · View findings

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