<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xml:base="https://docs.spec-kitty.ai/adr/3.x/2026-08-04-1-egress-consent-boundary/">
  <id>https://docs.spec-kitty.ai/adr/3.x/2026-08-04-1-egress-consent-boundary/</id>
  <title>ADR: The Egress-Consent Boundary — Consent Is Keyed on the Record Being Sent, Never on Ambient Context</title>
  <updated>2026-08-04T00:00:00.000Z</updated>
  <author><name>Spec Kitty</name></author>
  <link rel="alternate" type="text/html" href="https://docs.spec-kitty.ai/adr/3.x/2026-08-04-1-egress-consent-boundary/"/>
  <summary>Egress consent is keyed on the record being sent, never on ambient context: one refusal presentation where only `None` is permission, with per-transport identifier fragments.</summary>
  <content type="html">&lt;h2 id=&quot;context-and-problem-statement&quot;&gt;Context and Problem Statement&lt;/h2&gt;
&lt;p&gt;Two SaaS transports put project-identifying text on the wire: the tracker transport
(&lt;code dir=&quot;auto&quot;&gt;specify_cli/tracker/saas_client.py&lt;/code&gt;) and the widen-mode SaaS client
(&lt;code dir=&quot;auto&quot;&gt;specify_cli/saas_client/client.py&lt;/code&gt;). A mission slug is a
&lt;a href=&quot;/context/identity/#engagement&quot;&gt;client engagement name&lt;/a&gt;, so &lt;em&gt;which project consented&lt;/em&gt;
is a confidentiality question, not a convenience one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The boundary that answers it had no presence in either charter authority path.&lt;/strong&gt; Measured
before this ADR existed, with a controlled diagnostic (a known-present term returned 12 hits,
a nonsense term returned 0):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;grep -rn &quot;resolve_egress_consent\|ConsentedBatch\|project_egress_refusal&quot; docs/adr/3.x/ docs/context/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;-&gt; 0 hits&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;A P0 mission (#3030) built &lt;code dir=&quot;auto&quot;&gt;ConsentedBatch&lt;/code&gt;, a boundary guard and a renamed registry seam, and
recorded the rationale only in a mission-local tracer file that no maintainer editing a transport
will read — while the charter instructs every agent to read &lt;code dir=&quot;auto&quot;&gt;docs/adr/3.x/&lt;/code&gt; when they change a
structural boundary. This ADR is the durable record. It is the only part of mission
&lt;code dir=&quot;auto&quot;&gt;egress-refusal-consolidation-3110-01KYW895&lt;/code&gt; that acts on &lt;strong&gt;recurrence&lt;/strong&gt; rather than on an
instance.&lt;/p&gt;
&lt;h3 id=&quot;the-instance-that-forced-it-3111-is-consent-laundering&quot;&gt;The instance that forced it: #3111 is consent &lt;em&gt;laundering&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty agent decision widen&lt;/code&gt; resolved the project root from the &lt;strong&gt;operator’s location&lt;/strong&gt;
(&lt;code dir=&quot;auto&quot;&gt;locate_project_root() or Path.cwd()&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;cli/commands/decision.py&lt;/code&gt;) while &lt;code dir=&quot;auto&quot;&gt;decision_id&lt;/code&gt; is an
&lt;strong&gt;operator-supplied argument&lt;/strong&gt;. Standing in consenting project A and widening a decision owned
by B sent &lt;strong&gt;B’s identifier to A’s team, under A’s token&lt;/strong&gt; — and &lt;strong&gt;every consent gate answered
truthfully, about the wrong project.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That distinction matters for the fix. It is not unconsented egress: the gate at
&lt;code dir=&quot;auto&quot;&gt;saas_client/client.py&lt;/code&gt; runs &lt;em&gt;before&lt;/em&gt; &lt;code dir=&quot;auto&quot;&gt;url = f&quot;{self._base_url}{path}&quot;&lt;/code&gt;, so a non-consenting
checkout already transmits nothing. Nothing was bypassed. The wrong question was asked.&lt;/p&gt;
&lt;h2 id=&quot;decision-drivers&quot;&gt;Decision Drivers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The same policy was written twice — once per transport — as two near-identical modules a future
editor could change independently.&lt;/li&gt;
&lt;li&gt;The bug class recurs: it has been found and closed &lt;strong&gt;five&lt;/strong&gt; times before this mission, each
time in a new place, and &lt;strong&gt;twice more during &lt;em&gt;review of this mission&lt;/em&gt;&lt;/strong&gt; — seven in total,
which is the row count of the table below. (An earlier draft said “six … and twice more”,
i.e. eight, contradicting its own table. The five are enumerated in the mission handoff:
the current working directory, &lt;code dir=&quot;auto&quot;&gt;repo_root&lt;/code&gt;, machine-global arming, daemon scope, and a
checkout-level grant.)&lt;/li&gt;
&lt;li&gt;The existing protection is an AST guard whose reach is syntactic, and reading it as an ownership
proof is a live hazard.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;decision-outcome&quot;&gt;Decision Outcome&lt;/h2&gt;
&lt;p&gt;Three things are decided, and all three are load-bearing.&lt;/p&gt;
&lt;h3 id=&quot;1-the-boundary-is-one-presentation-srcspecify_cliegresspy&quot;&gt;1. The boundary is one presentation: &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/egress.py&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;project_egress_refusal(project_root, identifiers) -&gt; str | None&lt;/code&gt; is the single editable
presentation of the project-egress refusal policy. &lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;None&lt;/code&gt; — and only &lt;code dir=&quot;auto&quot;&gt;None&lt;/code&gt; — is permission.&lt;/strong&gt;
Both transports now reach the policy through it; the module is owned by neither.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each transport passes &lt;strong&gt;its own identifier-set fragment as an argument&lt;/strong&gt; —
&lt;code dir=&quot;auto&quot;&gt;TRACKER_EGRESS_IDENTIFIER_KINDS = &quot;mission and engagement identifiers&quot;&lt;/code&gt;,
&lt;code dir=&quot;auto&quot;&gt;SAAS_EGRESS_IDENTIFIER_KINDS = &quot;mission and decision identifiers&quot;&lt;/code&gt;. The sets are asymmetric on
purpose: the tracker carries no &lt;code dir=&quot;auto&quot;&gt;decision_id&lt;/code&gt;, so a union sentence would tell a tracker operator
that a decision id was at stake which that transport cannot transmit. The fragments are
&lt;em&gt;arguments&lt;/em&gt;, not second presentations.&lt;/li&gt;
&lt;li&gt;The module does &lt;strong&gt;not&lt;/strong&gt; re-derive the checkout → project → consent chain. It asks
&lt;code dir=&quot;auto&quot;&gt;invocation.adapters.resolve_egress_consent&lt;/code&gt;, a CORE registry slot that &lt;code dir=&quot;auto&quot;&gt;sync&lt;/code&gt; fills with
&lt;code dir=&quot;auto&quot;&gt;_egress_consent_resolver&lt;/code&gt; — the one derivation, the same funnel the drain, the emitter, the
daemon and &lt;code dir=&quot;auto&quot;&gt;local_commit&lt;/code&gt; all walk.&lt;/li&gt;
&lt;li&gt;Consolidation changed &lt;strong&gt;no operator-visible text&lt;/strong&gt;: both refusal strings render byte-for-byte as
before.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What would overturn this:&lt;/strong&gt; a second module that renders a refusal sentence; an identifier kind
hard-coded into the shared template (that hands one transport the other’s vocabulary); or a local
re-derivation of consent inside &lt;code dir=&quot;auto&quot;&gt;egress.py&lt;/code&gt;. A “consolidation” that left two templates and merely
parameterised them would not satisfy this decision either.&lt;/p&gt;
&lt;h3 id=&quot;2-the-provenance-invariant--and-it-supersedes-the-framing-this-mission-started-with&quot;&gt;2. The provenance invariant — and it &lt;strong&gt;supersedes&lt;/strong&gt; the framing this mission started with&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Consent must be keyed on something derived from the RECORD BEING SENT, never from ambient
context.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The earlier framing was &lt;em&gt;“a path-typed seam is the defect”&lt;/em&gt; — take a &lt;code dir=&quot;auto&quot;&gt;project_uuid&lt;/code&gt; instead of a
&lt;code dir=&quot;auto&quot;&gt;Path&lt;/code&gt; and the class closes. &lt;strong&gt;That framing is superseded and should not be re-proposed.&lt;/strong&gt;
&lt;code dir=&quot;auto&quot;&gt;resolve(project_uuid_of(locate_project_root()))&lt;/code&gt; is the same defect respelled: it is still
ambient. &lt;strong&gt;A type cannot express provenance.&lt;/strong&gt; That is why a uuid-typed seam is &lt;em&gt;optional&lt;/em&gt; rather
than indicated (open question Q3 / follow-up FU-5): it would not have prevented #3111.&lt;/p&gt;
&lt;p&gt;The converse also holds, and is the reason a path-keyed site is not automatically suspect: some
path-keyed sites are &lt;strong&gt;sound because the path is derived from the data.&lt;/strong&gt;
&lt;code dir=&quot;auto&quot;&gt;tracker.origin.bind_mission_origin&lt;/code&gt; walks &lt;em&gt;up&lt;/em&gt; from the &lt;code dir=&quot;auto&quot;&gt;feature_dir&lt;/code&gt; whose &lt;code dir=&quot;auto&quot;&gt;meta.json&lt;/code&gt; supplies
the very &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;mission_slug&lt;/code&gt; being sent; &lt;code dir=&quot;auto&quot;&gt;mission_creation&lt;/code&gt; builds that directory under
the same root the issue title is read from. Owner and root agree by derivation, not by locality.&lt;/p&gt;
&lt;p&gt;The substitute-for-the-record’s-own-project is what recurs. Found and closed so far:&lt;/p&gt;





































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Substitute&lt;/th&gt;&lt;th&gt;Where&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;the current working directory&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;decision widen&lt;/code&gt;’s root resolution (#3111)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;repo_root&lt;/code&gt;&lt;/td&gt;&lt;td&gt;construction sites that attributed the client to the checkout, not the payload&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;machine-global arming&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;SPEC_KITTY_ENABLE_SAAS_SYNC&lt;/code&gt; — one export carried five never-opted-in projects (2026-07-27 incident)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;daemon scope&lt;/td&gt;&lt;td&gt;a long-lived process reusing one client across projects&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;a checkout-level grant&lt;/td&gt;&lt;td&gt;consent recorded for the checkout rather than for the project&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;a symlinked &lt;code dir=&quot;auto&quot;&gt;kitty-specs/&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;em&gt;found in review of this mission, not in its design&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;a symlinked &lt;code dir=&quot;auto&quot;&gt;&amp;#x3C;mission&gt;/decisions/&lt;/code&gt;&lt;/strong&gt; (or &lt;code dir=&quot;auto&quot;&gt;decisions/index.json&lt;/code&gt;)&lt;/td&gt;&lt;td&gt;&lt;em&gt;found in review of this mission, not in its design&lt;/em&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The last two are the sharpest evidence that the invariant is about provenance and not about types:
both were reached through code written &lt;strong&gt;specifically to prevent&lt;/strong&gt; #3111, and both reproduced #3111’s
request line verbatim — B’s identifier, addressed to A’s team, under A’s token. With
&lt;code dir=&quot;auto&quot;&gt;A/kitty-specs -&gt; B/kitty-specs&lt;/code&gt; the command exited 0 and put B’s &lt;code dir=&quot;auto&quot;&gt;decision_id&lt;/code&gt; on the wire; the
paired control (no symlink) refused with zero requests. &lt;code dir=&quot;auto&quot;&gt;.resolve()&lt;/code&gt; follows the link, so every
downstream &lt;code dir=&quot;auto&quot;&gt;is_relative_to(specs_root)&lt;/code&gt; was measured against the &lt;em&gt;resolved target&lt;/em&gt; and containment
held trivially.&lt;/p&gt;
&lt;p&gt;They are closed by &lt;strong&gt;containment, asserted at three depths&lt;/strong&gt;: &lt;code dir=&quot;auto&quot;&gt;specs_root.is_relative_to(root)&lt;/code&gt; before any
&lt;code dir=&quot;auto&quot;&gt;stat(2)&lt;/code&gt;, and again on the file actually opened, measured against the &lt;strong&gt;acting root&lt;/strong&gt; rather than
the mission directory — because the mission-directory check sits two levels above the file a
symlinked &lt;code dir=&quot;auto&quot;&gt;decisions/&lt;/code&gt; redirects. The third is the &lt;strong&gt;resolved mission candidate&lt;/strong&gt; itself
(&lt;code dir=&quot;auto&quot;&gt;ownership.py:387&lt;/code&gt;), which predates this mission’s symlink findings and is what the two new
checks bracket. A symlink &lt;em&gt;within&lt;/em&gt; the root still works, so monorepo layouts are unaffected.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What would overturn this:&lt;/strong&gt; a consent decision keyed on &lt;code dir=&quot;auto&quot;&gt;Path.cwd()&lt;/code&gt;, an env flag, a destination
team, a token’s existence, or any root not derived from the record. &lt;strong&gt;What it does not cover, by
construction:&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;mount --bind B/kitty-specs A/kitty-specs&lt;/code&gt; is transparent to &lt;code dir=&quot;auto&quot;&gt;realpath&lt;/code&gt;, so no
path-based containment check can see it. That is a limit of the approach, recorded rather than
papered over; closing it needs a different mechanism, not a stricter path check.&lt;/p&gt;
&lt;h3 id=&quot;3-the-attribution-guard-is-syntactic--it-is-not-an-ownership-proof&quot;&gt;3. The attribution guard is &lt;strong&gt;SYNTACTIC&lt;/strong&gt; — it is not an ownership proof&lt;/h3&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;test_every_production_construction_site_attributes_its_project&lt;/code&gt; AST-scans &lt;code dir=&quot;auto&quot;&gt;src/&lt;/code&gt; and proves that
a project root &lt;strong&gt;was passed&lt;/strong&gt; to every construction site. Its own docstring concedes the limit:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“It cannot prove the root is the &lt;strong&gt;right&lt;/strong&gt; one.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Say it here so a future reader does not read a green guard as an ownership proof. Two safety nets
stand behind it and neither replaces it — a root that is not a project root resolves to no uuid and
therefore &lt;strong&gt;denies&lt;/strong&gt;, and a checkout declaring a &lt;em&gt;different&lt;/em&gt; uuid is ignored by the consent vote.
What neither net catches is the case the precondition exists for: a &lt;strong&gt;valid root for the wrong
project.&lt;/strong&gt; What actually bounds &lt;code dir=&quot;auto&quot;&gt;decision widen&lt;/code&gt;, the one site where root and subject can
legitimately diverge, is the ownership check below — not the guard.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This one has no falsifier, and that is the point.&lt;/strong&gt; It is a stated limit, not a claim awaiting
disproof. What &lt;em&gt;would&lt;/em&gt; overturn it is a guard that could decide ownership from source text, and
that requires a mapping which does not exist:&lt;/p&gt;
&lt;h2 id=&quot;ownership-is-positional-which-is-why-the-check-is-a-within-checkout-search&quot;&gt;Ownership is &lt;strong&gt;positional&lt;/strong&gt;, which is why the check is a within-checkout search&lt;/h2&gt;
&lt;p&gt;There is no &lt;code dir=&quot;auto&quot;&gt;decision_id&lt;/code&gt; → owning-project mapping anywhere, locally or remotely.
&lt;code dir=&quot;auto&quot;&gt;decisions.models.IndexEntry&lt;/code&gt; is &lt;code dir=&quot;auto&quot;&gt;frozen=True, extra=&quot;forbid&quot;&lt;/code&gt; and carries only &lt;code dir=&quot;auto&quot;&gt;mission_id&lt;/code&gt; +
&lt;code dir=&quot;auto&quot;&gt;mission_slug&lt;/code&gt;, so a &lt;code dir=&quot;auto&quot;&gt;project_uuid&lt;/code&gt; &lt;strong&gt;cannot even be present&lt;/strong&gt; in a valid ledger file; record
creation takes &lt;code dir=&quot;auto&quot;&gt;repo_root&lt;/code&gt;, uses it and discards it; and the SaaS client’s five endpoints include
no “get decision”.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Ownership is encoded by which directory a ledger sits in, never as data.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So the search enumerates mission directories one level under &lt;code dir=&quot;auto&quot;&gt;&amp;#x3C;repo_root&gt;/kitty-specs/&lt;/code&gt; and
membership-tests each ledger. Its outcome is &lt;em&gt;owns it&lt;/em&gt; / &lt;em&gt;ownership not established&lt;/em&gt; — and it can
&lt;strong&gt;never&lt;/strong&gt; name project B (constraint C-009). Re-resolving token and team “from the owning root” is
therefore not implementable here; what blocks it is the absence of a &lt;strong&gt;checkout enumeration&lt;/strong&gt;,
which is a different and buildable thing, deferred.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There is no fall-through to the acting root&lt;/strong&gt; — not in the broad form, and not in the narrow
“no &lt;code dir=&quot;auto&quot;&gt;kitty-specs/&lt;/code&gt; at all, so allow it” form, which reinstates exactly the leak this closes.
An unreadable ledger never vetoes a positive hit elsewhere: refusal is correct only when the search
terminates with &lt;strong&gt;no hit AND at least one unreadable ledger.&lt;/strong&gt; Measured: 49 ledgers across 333
mission directories in this repository, so an unrelated corrupt file is not theoretical; the
one-level enumeration and a repo-wide &lt;code dir=&quot;auto&quot;&gt;rglob&lt;/code&gt; return the same 49 with 0 missed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What would overturn this:&lt;/strong&gt; an owner field appearing on a ledger entry — a &lt;code dir=&quot;auto&quot;&gt;project_uuid&lt;/code&gt;, or any
data that identifies the owning project. That would make an identifying answer possible and would
change the shape of the check, not merely its performance.&lt;/p&gt;
&lt;h2 id=&quot;pathexists-is-eacces-divergent-and-this-mission-removed-it-three-times&quot;&gt;&lt;code dir=&quot;auto&quot;&gt;Path.exists()&lt;/code&gt; is EACCES-divergent, and this mission removed it three times&lt;/h2&gt;
&lt;p&gt;This is the single most repeated defect in the mission. &lt;code dir=&quot;auto&quot;&gt;store.load_index&lt;/code&gt; opened with
&lt;code dir=&quot;auto&quot;&gt;if not path.exists(): return DecisionIndex(...)&lt;/code&gt;. For a ledger whose containing &lt;code dir=&quot;auto&quot;&gt;decisions/&lt;/code&gt;
directory is unreadable, &lt;code dir=&quot;auto&quot;&gt;stat(2)&lt;/code&gt; needs search permission on the parent (POSIX, not an interpreter
quirk), and &lt;code dir=&quot;auto&quot;&gt;Path.exists()&lt;/code&gt; handles the resulting &lt;code dir=&quot;auto&quot;&gt;EACCES&lt;/code&gt; &lt;strong&gt;differently per interpreter&lt;/strong&gt;.
Measured in this clone, non-root euid, through &lt;code dir=&quot;auto&quot;&gt;load_index&lt;/code&gt; itself, control first:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;3.11.15            3.12.13            3.14.4&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;CONTROL readable      1 entry, hit       1 entry, hit       1 entry, hit&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;file=0o000            PermissionError    PermissionError    PermissionError&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;decisions/=0o000      PermissionError    PermissionError    OK, 0 entries&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The last row is the trap: on &lt;strong&gt;both CI interpreters&lt;/strong&gt; it raises uncaught — a traceback where an
operator-actionable refusal belongs — while on 3.14 it silently yields an empty index. &lt;strong&gt;It ships
a traceback from a local run that was green.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;Path.is_dir()&lt;/code&gt; is the same call with the same divergence.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;Path.glob&lt;/code&gt; is the mirror-image hazard: it &lt;strong&gt;swallows&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;EACCES&lt;/code&gt; and returns &lt;code dir=&quot;auto&quot;&gt;[]&lt;/code&gt; on all three
interpreters, so an &lt;code dir=&quot;auto&quot;&gt;except OSError&lt;/code&gt; wrapped around a glob is unreachable — effect-free handling
that reads as a handled case while handling nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The remedy is &lt;code dir=&quot;auto&quot;&gt;Path.stat()&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;os.stat&lt;/code&gt;, and only those.&lt;/strong&gt; They raise &lt;code dir=&quot;auto&quot;&gt;EACCES&lt;/code&gt; on &lt;em&gt;every&lt;/em&gt;
interpreter; it is the predicate that changed, and &lt;strong&gt;at 3.14, not 3.13&lt;/strong&gt;. Measured on four,
non-root euid, via a symlink into a &lt;code dir=&quot;auto&quot;&gt;0o000&lt;/code&gt; directory:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;3.11.15   3.12.13   3.13.12   3.14.4&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Path.stat() / os.stat      RAISES    RAISES    RAISES    RAISES&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Path.is_dir()              RAISES    RAISES    RAISES    False&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;3.14 rewrote the predicate to &lt;code dir=&quot;auto&quot;&gt;if follow_symlinks: return os.path.isdir(self)&lt;/code&gt;, and
&lt;code dir=&quot;auto&quot;&gt;os.path.isdir&lt;/code&gt; swallows every &lt;code dir=&quot;auto&quot;&gt;OSError&lt;/code&gt;. Through 3.13 it was &lt;code dir=&quot;auto&quot;&gt;S_ISDIR(self.stat().st_mode)&lt;/code&gt;
under &lt;code dir=&quot;auto&quot;&gt;except OSError: if not _ignore_error(e): raise&lt;/code&gt;, and &lt;code dir=&quot;auto&quot;&gt;_ignore_error&lt;/code&gt; covers only
&lt;code dir=&quot;auto&quot;&gt;ENOENT&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;ENOTDIR&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;EBADF&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;ELOOP&lt;/code&gt;, so &lt;code dir=&quot;auto&quot;&gt;EACCES&lt;/code&gt; propagated. Where the code must &lt;em&gt;observe&lt;/em&gt; an
unreadable path — to record it, refuse on it, or say which one it was — the predicate cannot
express that and &lt;code dir=&quot;auto&quot;&gt;S_ISDIR(p.stat().st_mode)&lt;/code&gt; can.&lt;/p&gt;
&lt;p&gt;Two traps in measuring this, both of which caught us. &lt;code dir=&quot;auto&quot;&gt;hasattr(pathlib, &quot;_ignore_error&quot;)&lt;/code&gt; is
&lt;code dir=&quot;auto&quot;&gt;False&lt;/code&gt; from 3.13, because 3.13 makes &lt;code dir=&quot;auto&quot;&gt;pathlib&lt;/code&gt; a package and moves the helper out of the
top-level namespace — a layout change that reads exactly like the behaviour change, one minor
version early. And the non-default &lt;code dir=&quot;auto&quot;&gt;follow_symlinks=False&lt;/code&gt; branch still goes through &lt;code dir=&quot;auto&quot;&gt;stat()&lt;/code&gt;,
so a probe that passes it measures the arm the code does not take. &lt;strong&gt;Measure the call as
called, not the namespace around it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This mission shipped that defect once and then closed it, which is the part worth recording.
&lt;code dir=&quot;auto&quot;&gt;_mission_dirs&lt;/code&gt; classified candidates with &lt;code dir=&quot;auto&quot;&gt;resolved.is_dir()&lt;/code&gt;, so on 3.14+ an unreadable
candidate took the bare &lt;code dir=&quot;auto&quot;&gt;continue&lt;/code&gt; instead of the &lt;code dir=&quot;auto&quot;&gt;except OSError&lt;/code&gt; that records it — &lt;strong&gt;LOW-8’s
original defect, reintroduced by LOW-8’s own fix.&lt;/strong&gt; It was measured (&lt;code dir=&quot;auto&quot;&gt;33 passed&lt;/code&gt; on 3.11.15 and
3.12.13; &lt;code dir=&quot;auto&quot;&gt;2 failed, 31 passed&lt;/code&gt; on 3.14.4), filed as
&lt;a href=&quot;https://github.com/Priivacy-ai/spec-kitty/issues/3177&quot;&gt;#3177&lt;/a&gt;, and deferred — the reasoning
being that it is fail-closed (&lt;code dir=&quot;auto&quot;&gt;owned=False&lt;/code&gt;, nothing transmits) and therefore a &lt;em&gt;diagnosis&lt;/em&gt;
defect rather than a leak.&lt;/p&gt;
&lt;p&gt;Deferring it was the wrong call, for a reason the deferral itself records: &lt;code dir=&quot;auto&quot;&gt;requires-python&lt;/code&gt;
is &lt;code dir=&quot;auto&quot;&gt;&gt;=3.11&lt;/code&gt;, so 3.14 is admitted, and &lt;strong&gt;no CI job runs pytest above 3.12&lt;/strong&gt; — the deferral would
have parked a known regression where no gate could ever rediscover it, with two tests left
permanently red to mark the spot. It is closed here instead, by the remedy #3177 itself
proposed: route the candidate through an explicit probe rather than a predicate.&lt;/p&gt;
&lt;p&gt;How strong “supported” is here is worth stating plainly rather than settling: &lt;code dir=&quot;auto&quot;&gt;requires-python&lt;/code&gt;
admits 3.14, but the trove classifiers stop at 3.13, &lt;code dir=&quot;auto&quot;&gt;.python-version&lt;/code&gt; pins 3.11.15, and the
owning shard pins 3.12. So 3.14 is reachable but neither claimed nor exercised. That caps the
severity — it does not make a silently-wrong diagnosis in shipped code correct.&lt;/p&gt;
&lt;p&gt;The generalisable rule is about the &lt;em&gt;direction&lt;/em&gt; of the divergence. A call that raises where you
expected a value fails loudly. A call that returns a value where you expected a raise leaves the
handler beneath it &lt;strong&gt;present and inert&lt;/strong&gt; — code that reads as a handled case while handling
nothing, indistinguishable from correct on inspection and on any interpreter that still raises.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The correct probes are &lt;code dir=&quot;auto&quot;&gt;open()&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;iterdir()&lt;/code&gt;, which ask the kernel the same question and get
the same answer everywhere. &lt;code dir=&quot;auto&quot;&gt;iterdir&lt;/code&gt; also answers &lt;em&gt;absent&lt;/em&gt; vs &lt;em&gt;unlistable&lt;/em&gt; in one call, so the
divergent call is not needed at all.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Removed &lt;strong&gt;three&lt;/strong&gt; times in one module: &lt;code dir=&quot;auto&quot;&gt;load_index&lt;/code&gt;’s &lt;code dir=&quot;auto&quot;&gt;exists()&lt;/code&gt;; a &lt;code dir=&quot;auto&quot;&gt;specs_root.exists()&lt;/code&gt; guard
added while fixing something else; and &lt;code dir=&quot;auto&quot;&gt;candidate.is_dir()&lt;/code&gt; on mission directories. There is now a
&lt;strong&gt;standing AST guard&lt;/strong&gt; — &lt;code dir=&quot;auto&quot;&gt;test_ownership_module_has_no_unguarded_eacces_divergent_stat_call&lt;/code&gt; —
which permits these calls only inside a &lt;code dir=&quot;auto&quot;&gt;try&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What would overturn the ban:&lt;/strong&gt; a supported-interpreter floor at 3.14+, at which point the
divergence disappears. It has not been reached. &lt;strong&gt;What detects a regression:&lt;/strong&gt; the AST guard reds.&lt;/p&gt;
&lt;h2 id=&quot;identity-is-a-detector-never-an-actuator&quot;&gt;Identity is a &lt;strong&gt;detector&lt;/strong&gt;, never an &lt;strong&gt;actuator&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code dir=&quot;auto&quot;&gt;from X import f&lt;/code&gt; binds by value. Patching the shared module’s definition site is therefore
&lt;strong&gt;inert&lt;/strong&gt; at both decision points — measured: after patching the definition alone, both decision
points still returned the pre-patch value. &lt;strong&gt;No module or package layout changes that.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;What the single-module form buys is &lt;em&gt;detection&lt;/em&gt;: the definition site &lt;strong&gt;is&lt;/strong&gt; the imported name, so
patching it makes the identity assertion red. Under the earlier package form the same patch was
inert &lt;strong&gt;and&lt;/strong&gt; the assertion stayed green — an undetectable no-op.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The single-module form converts a silent no-op into a &lt;strong&gt;detected&lt;/strong&gt; one. It does not make
one-name patching effective.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Recording this closure as &lt;em&gt;“the patch now reaches both decision points”&lt;/em&gt; would re-arm the exact
error it corrects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What would overturn this:&lt;/strong&gt; a mutation experiment showing a definition-site patch changing a call
site’s behaviour without any change to the import form.&lt;/p&gt;
&lt;h2 id=&quot;consequences&quot;&gt;Consequences&lt;/h2&gt;
&lt;h3 id=&quot;positive&quot;&gt;Positive&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;One place to edit the refusal policy, and a stated invariant a reviewer can apply to a new
construction site without re-deriving six incidents.&lt;/li&gt;
&lt;li&gt;The bug class is named in the form that generalises (provenance), so the next instance is
recognisable even when it does not look like a path.&lt;/li&gt;
&lt;li&gt;Three limits are on the record — the guard’s syntactic reach, C-009’s unidentifiability, and
bind-mount invisibility — so none of them can be mistaken for a green.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;negative--accepted-trade-offs&quot;&gt;Negative / accepted trade-offs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The ownership answer is deliberately weaker than operators may expect: it can refuse, but it can
never tell you &lt;em&gt;who&lt;/em&gt; owns the decision. That is C-009, not an omission.&lt;/li&gt;
&lt;li&gt;Containment is asserted at &lt;strong&gt;three&lt;/strong&gt; depths — &lt;code dir=&quot;auto&quot;&gt;ownership.py:303&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;:387&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;:440&lt;/code&gt;. A &lt;strong&gt;fourth&lt;/strong&gt;
would need a fourth assertion; the pattern is not self-extending. An earlier draft said two,
omitting the pre-existing mission-candidate check at &lt;code dir=&quot;auto&quot;&gt;:387&lt;/code&gt; — which meant a reader auditing
the module against this ADR would find an assertion the ADR implied should not yet exist,
and could not tell whether it was the pattern extending itself or an undocumented addition.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;decision widen&lt;/code&gt; remains the weakest of the four SaaS construction sites by design — its subject
is not derived from its root — and it is bounded by a check rather than by structure.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;neutral&quot;&gt;Neutral&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;egress.py&lt;/code&gt; is classified INTEGRATION, so it may reach &lt;code dir=&quot;auto&quot;&gt;specify_cli.sync&lt;/code&gt;. The layering rule did
not force the registry route; the single-derivation ground did.&lt;/li&gt;
&lt;li&gt;The earlier per-transport &lt;code dir=&quot;auto&quot;&gt;*/egress_consent.py&lt;/code&gt; modules are deleted, not shimmed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;confirmation--and-what-this-adr-does-not-prove&quot;&gt;Confirmation — and what this ADR does &lt;strong&gt;not&lt;/strong&gt; prove&lt;/h3&gt;
&lt;p&gt;The criterion attached to this ADR (SC-019) is a &lt;strong&gt;grep-gate&lt;/strong&gt;, and its own text says so:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;grep -rn &quot;resolve_egress_consent\|ConsentedBatch\|project_egress_refusal&quot; docs/adr/3.x/ docs/context/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;must return a non-zero count with the file named. &lt;strong&gt;A file containing only those three search
terms passes it.&lt;/strong&gt; That is accepted rather than papered over — the alternative pins prose wording,
and this document’s value is in being read, not in being matched. &lt;strong&gt;So its content is a review
item, not a criterion.&lt;/strong&gt; If you are here to check the boundary, read the three decisions; do not
trust the green.&lt;/p&gt;
&lt;p&gt;Two further honesty notes, so a successor does not re-take measurements that were never made:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every green on this mission’s test surface was taken as an &lt;strong&gt;isolated single-file run&lt;/strong&gt; (#3115’s
sync half is open, deferred to #3136). A full-suite red on these files is not attributable to
them.&lt;/li&gt;
&lt;li&gt;No CI run has been &lt;em&gt;observed&lt;/em&gt; executing the shard that carries the consolidated module’s tests.
The claim that it runs rests on a parse of the workflow YAML plus a reading of the job’s &lt;code dir=&quot;auto&quot;&gt;if:&lt;/code&gt;,
which agree — but agreement between two readings of the same file is not an execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;alternatives-considered&quot;&gt;Alternatives considered&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A uuid-typed seam&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;resolve(project_uuid)&lt;/code&gt; instead of &lt;code dir=&quot;auto&quot;&gt;resolve(Path)&lt;/code&gt;). Rejected as the
&lt;em&gt;fix&lt;/em&gt;, kept as optional cleanup: a type cannot express provenance, and the uuid can be derived
from ambient context just as easily as the path was.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Re-resolve token and team from the owning root.&lt;/strong&gt; Not implementable: it requires identifying
project B, which C-009 forbids with the data that exists.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep two per-transport presentations and parameterise them.&lt;/strong&gt; Rejected — that is two editable
presentations wearing one interface, which is the defect, not its repair.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A ULID shape check at the CLI as the bound.&lt;/strong&gt; Rejected as &lt;em&gt;the&lt;/em&gt; bound and kept as
defence-in-depth: a well-formed ULID present in another project’s ledger is exactly the attack,
so shape proves nothing about ownership. The claim that the exposure was benign “because the id
is a ULID and therefore carries no engagement name” was &lt;strong&gt;measured false&lt;/strong&gt; — the value is
interpolated raw into the request line, so any text an operator types reaches the wire.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;more-information&quot;&gt;More Information&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;src/specify_cli/egress.py&lt;/code&gt; — the one presentation, the attribution precondition, and the
per-site enumeration of every construction site that must satisfy it.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;src/specify_cli/decisions/ownership.py&lt;/code&gt; — the positional-ownership search, the three
&lt;em&gt;could-not-look&lt;/em&gt; conditions and their distinct operator actions.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/specify_cli/saas_client/test_client_consent_gate_3030.py&lt;/code&gt;,
&lt;code dir=&quot;auto&quot;&gt;tests/sync/tracker/test_saas_client_consent_gate_3030.py&lt;/code&gt; — the two syntactic attribution
guards.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;tests/specify_cli/decisions/test_ownership_3111.py&lt;/code&gt; — the containment and EACCES guards,
including the standing AST guard on divergent &lt;code dir=&quot;auto&quot;&gt;stat&lt;/code&gt; calls.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/context/identity/#engagement&quot;&gt;Glossary: engagement&lt;/a&gt; — why a mission slug is
confidential.&lt;/li&gt;
&lt;li&gt;Issues: #3110 (consolidation), #3111 (the laundering instance), #3030 (the boundary’s origin),
#3136 (the deferred sync half of #3115).&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
