Skip to content

refactor(registries): url_scheme asks utils/net for local hosts - #4521

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-h-a2-registry-local-host-owner
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-h-a2-registry-local-host-owner

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Follow-up to #4304 and #4317: deps/registry/url_scheme.py _is_local_host now calls utils/net.py is_local_network_host. One owner now decides which hosts count as local network, so the duplicated RFC 1918 table is removed.

The registry URL scheme guard now requires this delegation, and the owner record is updated to match.

Important

Behaviour change (decided under S15, logged here). The old local table parsed hosts through parse_host_address, so http://167772161/apm, http://0x0a000001/apm and http://010.0.0.1/apm counted as 10.0.0.1 and were accepted without insecure: true. The shared owner parses strict dotted literals only, because socket resolvers read integer, hex and leading-zero spellings differently (a parser differential). Those spellings are now refused like any non-local host. Default taken: keep the stricter, fail-closed owner rather than re-adding a second parser. Migration: write the dotted address (http://10.0.0.1/apm) or set insecure: true. Pinned by registry-level tests under both manifest contracts, with a CHANGELOG line under Changed.

Based on train/0.37-final-2 (both #4304 and #4317 are in train 2); fold it after #4304.

Issue and approved scope

Follow-up to #4304 (#4286) and #4317 (#4314). Asked for by the S lead under the rule that review follow-ups are fixed in this release.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally (host emergency; CI validates)
  • All existing tests pass
  • Added tests for new functionality (if applicable): tests/unit/test_apm_yml_registries.py::TestRegistryUrlScheme::test_http_to_public_host_is_a_parse_error adds the three non-literal spellings

The existing RFC 1918 boundary tests stay the oracle: 10.x, 172.16.x and 192.168.x are accepted; 172.15.255.255 and 172.32.0.1 are refused. They are in tests/spec_conformance/test_security_behavior_reqs.py and tests/integration/test_registry_url_scheme_lifecycle.py. Ruff is clean.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md (Changed).
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- req-sc-006 is unchanged: it admits loopback and RFC 1918 private addresses, and the accepted dotted literals are the same; non-literal spellings were never named by the spec.

apm-spec-waiver: req-sc-006 accepted dotted literals unchanged; host classification moves to its shared owner, which refuses non-literal IPv4 spellings

@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 20, 2026
Base automatically changed from train/0.37-final-2 to main November 21, 2026 05:24
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-h-a2-registry-local-host-owner branch from a17cb8f to 858657f Compare November 21, 2026 08:25
Copilot AI balanced review requested due to automatic review settings November 21, 2026 08:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The shared URL helper rejects previously accepted noncanonical IPv4 registry URLs, causing manifest parsing failures and silently omitting user/workspace entries without migration documentation or registry-level regression coverage.

1 open issue
What changed in this PR

Consolidates registry URL host classification in utils/net.py, completing the shared-owner refactor from #4304 and #4317.

Changes:

  • Delegates registry local-host checks to is_local_network_host, removing the duplicate RFC 1918 table.
  • Updates the architecture guard and owner record to require the shared helper.
File Description
src/​apm_cli/​deps/​registry/​url_scheme.py Delegates local-host classification to the shared network helper.
scripts/​architecture_linter/​checks/​install_registry_url_scheme.py Requires the shared helper import and delegation.
.apm/​architecture/​owners/​install-deployment.json Records the shared helper as the local-host decision owner.

Review effort: Balanced

Comment thread src/apm_cli/deps/registry/url_scheme.py Resolved
registries.<name>.url acceptance now delegates its loopback / RFC 1918
host decision to utils/net.py is_local_network_host (#4317), so one owner
classifies local-network hosts. The RFC 1918 edge tests (10.x, 172.16.x,
192.168.x accepted; 172.15.255.255 and 172.32.0.1 refused) stay the oracle.
The registry URL scheme guard now requires the delegation.

apm-spec-waiver: req-sc-006 behaviour unchanged; host classification moves to its shared owner

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…4521)

Integer, hex and leading-zero forms of 10.0.0.1 were accepted for http://
without insecure: true; the shared owner (utils/net.py
is_local_network_host) parses strict literals only, because resolvers read
those forms differently. Pin the rejection at the registry level under both
manifest contracts and record the change in the CHANGELOG.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-h-a2-registry-local-host-owner branch from 858657f to 1d505e5 Compare November 21, 2026 09:16
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 5c18910 into main Nov 21, 2026
43 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-h-a2-registry-local-host-owner branch November 21, 2026 09:50
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (51e2e65, main f53aa79). Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- strict known cells for an MCP entry of a runtime no longer targeted (#4784)
  and a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Ledger regenerated (baseline 3, known-failing 1, required 2419).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (2e8592d, main acb0423). Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- strict known cells for an MCP entry of a runtime no longer targeted (#4784)
  and a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Ledger regenerated (baseline 3, known-failing 1, required 2419).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (2e8592d) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Ledger regenerated (baseline 3, known-failing 1, required 2419).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (699e837) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Review folds: I5 admits the compile record only as a regular file and its
newly created ancestor directories; run/preview, content-types, plugin-root
hook, lane C fresh twin and source-machine bundle identity oracles tightened.
Ledger regenerated (baseline 3, known-failing 1, required 2419).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (699e837) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Review folds: I5 admits the compile record only as a regular file and its
newly created ancestor directories; run/preview, content-types, plugin-root
hook, lane C fresh twin, source-machine bundle identity, self_defined warn and
hook bundle update oracles tightened. U-USER-SCOPE-ORG-POLICY removes explicit
user-scope cells only: the four scope-free T1 bin x denied-dependency cells are
required, witnessed by the project matrix refusals.
Ledger regenerated (baseline 3, known-failing 1, required 2423).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (699e837) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Review folds: I5 admits the compile record only as a regular file and its
newly created ancestor directories; run/preview, content-types, plugin-root
hook, lane C fresh twin, source-machine bundle identity, self_defined warn and
hook bundle update oracles tightened; the self_defined warn row is a real
warn-mode policy now and is strict known on #5070. U-USER-SCOPE-ORG-POLICY removes explicit
user-scope cells only: the four scope-free T1 bin x denied-dependency cells are
required, witnessed by the project matrix refusals.
Ledger regenerated (baseline 3, known-failing 1, required 2423).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (699e837) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Review folds: I5 admits the compile record only as a regular file and its
newly created ancestor directories; run/preview, content-types, plugin-root
hook, lane C fresh twin, source-machine bundle identity, self_defined warn and
hook bundle update oracles tightened; the self_defined warn row is a real
warn-mode policy now and is strict known on #5070; the #4826 refusal row checks rollback. U-USER-SCOPE-ORG-POLICY removes explicit
user-scope cells only: the four scope-free T1 bin x denied-dependency cells are
required, witnessed by the project matrix refusals.
Ledger regenerated (baseline 3, known-failing 1, required 2423).

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
…C, v0.38 sweep)

Stacked on corpus train 6 (699e837) and merged with main fc1866b. Cars:
- policy promise rows in test_policy_promises.py with a control each (scripts
  deny, self_defined, max_depth, require_resolution, source_attribution,
  unmanaged_files, fail_on_drift, pinned constraint, explicit includes,
  transitive MCP trust, content types); the #4826 install refusal is required
  now that #4853 fixed it on main.
- an MCP entry of a runtime no longer targeted (#4784) takes main's required
  row (its fix landed); a strict known cell for a codex hook copy that cannot read its plugin's skill (#2824).
- lane C incremental deploy differential (kit from #4849).
- v0.38.0 sweep: compile dependency-policy run and preview (#4734), a converged
  install writes nothing (#4790), hook bundle approval pin (#4688), a registry
  URL on a local host (#4521).
- burndown: a denied local bundle is refused unwritten (#4646), present-
  provenance-unknown x denied-executable (#4767), audit --ci judges locked
  content with apm_modules gone, merged-hook entry detection end to end (#4798).
Review folds: I5 admits the compile record only as a regular file and its
newly created ancestor directories; run/preview, content-types, plugin-root
hook, lane C fresh twin, source-machine bundle identity, self_defined warn and
hook bundle update oracles tightened; the self_defined warn row is a real
warn-mode policy now and is strict known on #5070; the #4826 refusal row checks rollback; no-write stamps add the POSIX change time. U-USER-SCOPE-ORG-POLICY removes explicit
user-scope cells only: the four scope-free T1 bin x denied-dependency cells are
required, witnessed by the project matrix refusals.
Ledger regenerated (baseline 3, known-failing 1, required 2423).

Co-authored-by: Copilot App <[email protected]>
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.

2 participants