feat(cli): --features strict-network — stack presets instead of the wildcard - #106
Merged
Merged
Conversation
Member
|
I guess the predefined network settings should hold as many presets, as stacks have been chosen? so each stack chosen (to install dependencies) translates to a network preset? |
…ildcard Builds on the network presets (#2/#105). `sandcat init --features strict-network` (or SANDCAT_STRICT_NETWORK=true) generates project settings whose `network` list holds one `{"preset": "<stack>"}` entry per resolved stack and no allow-all-GET wildcard, so anything beyond the stack registries and the user-settings layer (the agent's own API hosts) is denied by default — including DNS resolution. Kept opt-in on purpose: flipping the default would surprise every new project with "sandcat blocks the internet"; the summary line now states which policy the project got and how to switch. `init settings` grows --strict-network/--stacks flags; with no stacks the strict list is empty (user-settings layer only). Preset names are expanded by the addon at proxy start, so domain lists update with the sandcat version instead of freezing in the project file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
shejnowicz
force-pushed
the
feat/2-strict-network
branch
from
September 7, 2026 08:32
a7cd279 to
a3de325
Compare
Collaborator
Author
|
Exactly — that's what this PR does: with --features strict-network, every resolved stack becomes one {"preset": ""} entry in the project settings (so --stacks python,java → presets python + java; scala resolves to java scala via the existing stack-deps mechanism and gets both). A test keeps STACK_NAMES and the preset registry in sync so a new stack can't ship without a matching preset. |
Member
|
Ah ok, thanks :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #105 (network presets) — the base branch is
feat/2-network-presets; retarget to master after #105 merges. Follow-up to #2; no separate issue, so no close keyword.Summary
sandcat init --features strict-network(orSANDCAT_STRICT_NETWORK=true) generates project settings whosenetworklist holds one{"preset": "<stack>"}entry per resolved stack and no allow-all-GET wildcard. Everything beyond the stack registries and the user-settings layer (the agent's own API hosts) is then denied by default — including DNS resolution, so blocked hosts never even resolve.Network: strict — stack presets: python, javavsdefault (allow all GET; tighten with --features strict-network)).init settingsgrows--strict-network/--stacksflags; with no stacks the strict list is empty (user-settings layer only).scalaresolves tojava scalavia the existing stack-deps mechanism, so both presets are seeded.Test plan
init --stacks python --features strict-networkgenerates{\"network\":[{\"preset\":\"python\"}]}(no wildcard); stack healthy; pypi.org 200 (stack preset), www.anthropic.com + github.com 200 (presets expanded from the user-settings layer — expansion works across layers), example.com DNS REFUSED (rc=6 before HTTP); real PyPI package fetch end-to-end through the proxy (JSON API → wheel from files.pythonhosted.org, valid zip). Note:pip downloaditself is unavailable in the devbox/nix python (no ensurepip) — toolchain quirk, not policy; the fetch above covers the network path.🤖 Generated with Claude Code