| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-5006606 |
| 4 | status: adopted |
| 5 | title: "Let clients discover a project's owning valley from the target tree" |
| 6 | created: 2026-08-22 |
| 7 | source: review of the asker's policy defaults, 2026-08-22 |
| 8 | --- |
| 9 | |
| 10 | # Let clients discover a project's owning valley from the target tree |
| 11 | |
| 12 | A project carries a `policy/valley` file naming its owning valley's repository. Clients follow it to |
| 13 | find the governing policy. Ownership itself is declared by the valley; the project's pointer is a |
| 14 | discovery aid. |
| 15 | |
| 16 | The planned valley membership declaration arrives with support for multiple valleys. Until then, |
| 17 | host configuration supplies the ownership declaration used by the running integration service. |
| 18 | |
| 19 | ## Discovery |
| 20 | |
| 21 | The pointer contains one repository address in a form accepted by `git fetch`. Policy tools fetch |
| 22 | that repository and read `policy/instance` from its integrated tip. |
| 23 | |
| 24 | A valley repository carries its own `policy/instance` and can use that directly. It needs no pointer |
| 25 | to itself. Principals governed by a valley need fetch access to its policy repository. |
| 26 | |
| 27 | Once the authoritative membership declaration exists, a client must check that it agrees with the |
| 28 | pointer. A mismatch must produce an error. |
| 29 | |
| 30 | ## Match the integrator's inputs |
| 31 | |
| 32 | A client must derive checks from the same sources as the integrator: |
| 33 | |
| 34 | - Project policy from the target branch's tip. |
| 35 | - The ownership pointer from that same tip. |
| 36 | - The floor from the owning valley's integrated tip. |
| 37 | |
| 38 | Working-tree files and the proposed branch do not supply these inputs. Review should therefore give |
| 39 | the same answer from any checkout, including a stale one. |
| 40 | |
| 41 | A missing project layer adds nothing to the floor. Missing or unreadable governing inputs must be |
| 42 | reported under the current resolver's rules. |
| 43 | [[dcr-9c75283]](../decisions/dcr-9c75283-substrate-adoption-and-the-core.md) defines the separate |
| 44 | core-based bootstrap design and its activation prerequisite. |
| 45 | |
| 46 | Tools should default to these real governing sources. Alternate sources remain useful for explicit |
| 47 | inspection or testing, but must be selected deliberately. |
| 48 | |
| 49 | ## Authority and later discovery |
| 50 | |
| 51 | A proposed edit to `policy/valley` is evaluated under the policy that already governs the target. It |
| 52 | cannot use its own replacement pointer to choose the rules for admitting itself. The running |
| 53 | integrator also has its configured ownership source. |
| 54 | |
| 55 | Once repository addressing reliably identifies the valley, discovery may be possible from the clone |
| 56 | URL. The explicit pointer could then be retired. Until that mechanism exists, the pointer lets |
| 57 | `valley checks` and review's `[a]sk` find the floor. |
| 58 | |
| 59 | ## Open questions |
| 60 | |
| 61 | Each derivation currently fetches the valley repository again. Frequent automated use needs an |
| 62 | appropriate caching and freshness policy. |
| 63 | |
| 64 | The pointer identifies a repository but assumes `refs/heads/main`. It cannot yet select another |
| 65 | integrated ref. |
| 66 | |
| 67 | [[dcr-f41f718]](../decisions/dcr-f41f718-declared-verification-policy.md) defines policy |
| 68 | composition, and [[dcr-9b5da04]](../decisions/dcr-9b5da04-hosts-serve-isolated-valleys.md) defines |
| 69 | project ownership and hosting. |