|
1
|
+ |
defmodule OpenAgents.Vocabulary do
|
|
2
|
+ |
@moduledoc """
|
|
3
|
+ |
The ledger of durable names that keep the word `machine`.
|
|
4
|
+ |
|
|
5
|
+ |
The product says computer. `docs/taxonomy.md` settled that, and issue #134
|
|
6
|
+ |
settled what happens to the names underneath it: a `machine` name stays where
|
|
7
|
+ |
something outside this release can observe or replay it, and moves to
|
|
8
|
+ |
`computer` where it cannot. PostgreSQL is the clearest case of the first —
|
|
9
|
+ |
a table, column, constraint, or index name is read by rows an earlier release
|
|
10
|
+ |
wrote — so this module enumerates every durable name that is exempt, and
|
|
11
|
+ |
`OpenAgents.VocabularyTest` derives the live population from
|
|
12
|
+ |
`information_schema` and `pg_catalog` and fails when the two disagree.
|
|
13
|
+ |
|
|
14
|
+ |
The point is not the list. The point is that a new `machine`-named durable
|
|
15
|
+ |
surface cannot appear without someone adding it here and saying why, and a
|
|
16
|
+ |
removed one cannot linger here pretending to exist. See `INVARIANTS.md`,
|
|
17
|
+ |
CANON-002.
|
|
18
|
+ |
|
|
19
|
+ |
This ledger covers PostgreSQL only. The wire half of the same decision — the
|
|
20
|
+ |
controller protocol `openagents.computer.v1`, the `.v1` tool schemas, the
|
|
21
|
+ |
published response keys, the PubSub topics and Horde registry keys — is held
|
|
22
|
+ |
by its own contracts, because no query enumerates it.
|
|
23
|
+ |
"""
|
|
24
|
+ |
|
|
25
|
+ |
@tables ~w(machine_pairings machines repository_machine_grants)
|
|
26
|
+ |
|
|
27
|
+ |
@columns [
|
|
28
|
+ |
{"forge_assignments", "machine_id"},
|
|
29
|
+ |
{"inference_grants", "machine_id"},
|
|
30
|
+ |
{"machine_pairings", "machine_id"},
|
|
31
|
+ |
{"repository_machine_grants", "machine_id"},
|
|
32
|
+ |
{"work_jobs", "machine_id"}
|
|
33
|
+ |
]
|
|
34
|
+ |
|
|
35
|
+ |
@constraints [
|
|
36
|
+ |
{"forge_assignments", "forge_assignments_machine_id_fkey"},
|
|
37
|
+ |
{"inference_grants", "inference_grants_machine_id_fkey"},
|
|
38
|
+ |
{"machine_pairings", "machine_pairings_machine_id_fkey"},
|
|
39
|
+ |
{"machine_pairings", "machine_pairings_pkey"},
|
|
40
|
+ |
{"machine_pairings", "machine_pairings_status_check"},
|
|
41
|
+ |
{"machine_pairings", "machine_pairings_tier_check"},
|
|
42
|
+ |
{"machine_pairings", "machine_pairings_user_id_fkey"},
|
|
43
|
+ |
{"machines", "machines_pkey"},
|
|
44
|
+ |
{"machines", "machines_status_check"},
|
|
45
|
+ |
{"machines", "machines_tier_check"},
|
|
46
|
+ |
{"machines", "machines_token_expiry_after_creation"},
|
|
47
|
+ |
{"machines", "machines_user_id_fkey"},
|
|
48
|
+ |
{"repository_machine_grants", "repository_machine_grants_created_by_user_id_fkey"},
|
|
49
|
+ |
{"repository_machine_grants", "repository_machine_grants_machine_id_fkey"},
|
|
50
|
+ |
{"repository_machine_grants", "repository_machine_grants_operations_allowed"},
|
|
51
|
+ |
{"repository_machine_grants", "repository_machine_grants_operations_present"},
|
|
52
|
+ |
{"repository_machine_grants", "repository_machine_grants_pkey"},
|
|
53
|
+ |
{"repository_machine_grants", "repository_machine_grants_repository_id_fkey"},
|
|
54
|
+ |
{"work_jobs", "work_jobs_machine_id_fkey"}
|
|
55
|
+ |
]
|
|
56
|
+ |
|
|
57
|
+ |
@indexes [
|
|
58
|
+ |
{"forge_assignments", "forge_assignments_machine_id_index"},
|
|
59
|
+ |
{"forge_assignments", "forge_assignments_one_active_machine_index"},
|
|
60
|
+ |
{"inference_grants", "inference_grants_machine_id_index"},
|
|
61
|
+ |
{"machine_pairings", "machine_pairings_code_digest_index"},
|
|
62
|
+ |
{"machine_pairings", "machine_pairings_expires_at_index"},
|
|
63
|
+ |
{"machine_pairings", "machine_pairings_pkey"},
|
|
64
|
+ |
{"machines", "machines_pkey"},
|
|
65
|
+ |
{"machines", "machines_token_digest_index"},
|
|
66
|
+ |
{"machines", "machines_user_id_index"},
|
|
67
|
+ |
{"repository_machine_grants", "repository_machine_grants_machine_id_index"},
|
|
68
|
+ |
{"repository_machine_grants", "repository_machine_grants_pkey"},
|
|
69
|
+ |
{"repository_machine_grants", "repository_machine_grants_repository_id_machine_id_index"},
|
|
70
|
+ |
{"work_jobs", "work_jobs_machine_id_inserted_at_index"}
|
|
71
|
+ |
]
|
|
72
|
+ |
|
|
73
|
+ |
@doc "Tables whose name keeps `machine`."
|
|
74
|
+ |
@spec tables() :: [String.t()]
|
|
75
|
+ |
def tables, do: @tables
|
|
76
|
+ |
|
|
77
|
+ |
@doc "`{table, column}` pairs whose column name keeps `machine`."
|
|
78
|
+ |
@spec columns() :: [{String.t(), String.t()}]
|
|
79
|
+ |
def columns, do: @columns
|
|
80
|
+ |
|
|
81
|
+ |
@doc "`{table, constraint}` pairs whose constraint name keeps `machine`."
|
|
82
|
+ |
@spec constraints() :: [{String.t(), String.t()}]
|
|
83
|
+ |
def constraints, do: @constraints
|
|
84
|
+ |
|
|
85
|
+ |
@doc "`{table, index}` pairs whose index name keeps `machine`."
|
|
86
|
+ |
@spec indexes() :: [{String.t(), String.t()}]
|
|
87
|
+ |
def indexes, do: @indexes
|
|
88
|
+ |
end
|