@gettier/cli 0.0.0-stage → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +189 -2
  2. package/dist/cli.js +3093 -0
  3. package/package.json +39 -4
package/README.md CHANGED
@@ -1,3 +1,190 @@
1
- # Temporary Holding Version
1
+ # gettier
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Being right by luck is not knowing.**
4
+
5
+ Your agent writes a fix. The tests pass. But the fix rests on a premise about your
6
+ environment the agent could not see — which database it is connected to, what the reverse
7
+ proxy caps, which runtime production actually runs — and that premise is wrong. The code
8
+ works anyway, today, for reasons nobody checked.
9
+
10
+ `gettier` makes the agent write those premises down, then measures them.
11
+
12
+ ```sh
13
+ npm install -g @gettier/cli@beta
14
+ ```
15
+
16
+ > **Pilot beta.** Use the `beta` dist-tag for the pilot release. The local gate, sensors and MCP server are implemented. Claude
17
+ > Code hooks, Codex configuration and a packaged GitHub Action are not included in
18
+ > this release. Hosted telemetry requires a provisioned project key.
19
+ > Status: <https://docs.gettier.io/>
20
+
21
+ ## 60 seconds
22
+
23
+ ```sh
24
+ gettier init acme
25
+ ```
26
+
27
+ Write a sensor — a command that prints a reading:
28
+
29
+ ```yaml
30
+ # sensors.yaml
31
+ version: 1
32
+ sensors:
33
+ - id: db.identity
34
+ description: which database this service actually connects to
35
+ command: "node ./sensors/db-identity.js"
36
+ effects: none
37
+ params: {}
38
+ extract: [database]
39
+ redact: []
40
+ ttl: 60
41
+ timeout: 10
42
+ max_output_bytes: 1024
43
+ runs_as: gt-agent
44
+ verifies: [database.identity]
45
+ ```
46
+
47
+ Write down what the plan assumes:
48
+
49
+ ```json
50
+ // .gettier/declaration.json
51
+ {
52
+ "plan_summary": "Backfill the orders table against staging before the migration",
53
+ "lemmas": [
54
+ {
55
+ "claim": "the connected database is staging",
56
+ "provenance": "believed",
57
+ "load_bearing": true,
58
+ "falsifying_observation": {
59
+ "sensor": "db.identity", "key": "database", "operator": "!=", "value": "staging"
60
+ }
61
+ }
62
+ ]
63
+ }
64
+ ```
65
+
66
+ Run the gate:
67
+
68
+ ```sh
69
+ gettier check
70
+ ```
71
+
72
+ ```text
73
+ contradicted — 1 load-bearing of 1 declared · 1 contradicted · 0 unresolved · 0 verified by measurement
74
+
75
+ CONTRADICTED
76
+ the connected database is staging
77
+ claim says the connected database is 'staging' but db.identity reports current_database()='production'
78
+ ```
79
+
80
+ Exit code `2`. Nothing about the backfill code was wrong. The premise underneath it was, and
81
+ no test would have said so.
82
+
83
+ ## Commands
84
+
85
+ ```text
86
+ gettier init <project|.> [--environment env] [--registry path]
87
+ [--endpoint url | --local] [--force]
88
+ gettier status
89
+ gettier sensors list
90
+ gettier sensors run <id>
91
+ gettier check [--declaration path|-] [--markdown path] [--json]
92
+ [--require-evidence] [--hold-on-unverifiable] [--api-cwd dir]
93
+ gettier mcp
94
+ ```
95
+
96
+ Starting with `0.1.0-beta.2`, `gettier init .` uses the current directory's name: running it in
97
+ `/work/janeway-mcp` records `janeway-mcp` in `.gettier/project.json`. It initializes that
98
+ directory rather than creating another one. Explicit names such as `gettier init acme` still
99
+ work, and existing configuration requires `--force` to overwrite. At the filesystem root,
100
+ pass an explicit name because there is no directory name to infer.
101
+
102
+ `0.1.0-beta.1` records `.` literally; use an explicit project name with that older version.
103
+ Initialization does not create a hosted workspace.
104
+
105
+ **No Gettier server is involved.** The gate, the sensor registry and the sensor execution are
106
+ all local. Telemetry is optional; without a credential the CLI says `transport memory` rather
107
+ than implying delivery.
108
+
109
+ ## In CI
110
+
111
+ | Exit | Meaning |
112
+ |---|---|
113
+ | `0` | the gate allows the change |
114
+ | `2` | the gate says no — a premise was contradicted, or one nothing could settle |
115
+ | `1` | the check itself could not run |
116
+
117
+ `1` is separate from `2` on purpose. A job that cannot tell "the premises did not check out"
118
+ from "the tool crashed" gets switched off after the second false alarm.
119
+
120
+ ```sh
121
+ gettier check --markdown comment.md
122
+ ```
123
+
124
+ `--markdown` writes the comment to a file and **posts nothing**. This package holds no GitHub
125
+ credential and is not going to; the workflow that owns the token decides where it goes.
126
+
127
+ Worth knowing before you wire it in:
128
+
129
+ - **A catch fails the check.** Inside a proxied turn a contradiction is fed back and the
130
+ model replans. On a pull request there is no replan — the change is already written on top
131
+ of the premise a measurement disproved.
132
+ - **A claim no sensor covers does not fail it.** That is the registry having nothing to say,
133
+ reported so you know which sensor to write next. `--hold-on-unverifiable` changes that.
134
+ - **A sensor that matched a claim and could not run holds it** — including one whose command
135
+ ran and exited non-zero. Failure must never read as verification.
136
+ - **Provenance cannot be earned here.** With no ledger and no conversation, a lemma tagged
137
+ `measured` is judged as `believed` — stricter than the proxy, never looser.
138
+
139
+ Telemetry from a check carries **counts only** — never claim text.
140
+
141
+ ## `gettier mcp`
142
+
143
+ Three tools over stdio for any MCP-capable agent, so the agent declares its own premises
144
+ instead of you writing JSON by hand.
145
+
146
+ ```sh
147
+ claude mcp add gettier -- gettier mcp
148
+ ```
149
+
150
+ | Tool | What it does |
151
+ |---|---|
152
+ | `list_sensors` | what this repository can measure, and which assumption categories each sensor falsifies |
153
+ | `declare_lemmas` | the premises the plan rests on |
154
+ | `check_assumptions` | runs the sensors that bear on them and returns the contradictions |
155
+
156
+ The gate is **cooperative** here: an agent that never calls the tools is never gated.
157
+
158
+ - **No tool accepts a command.** The registry is readable, the gate is runnable, and there is
159
+ no third thing. Sensors execute by id only, from a registry you approved.
160
+ - **Sensor output comes back as framed data**, never as instructions.
161
+ - **stdout is the protocol channel**, so nothing else prints to it.
162
+ - **No runtime dependency.** The JSON-RPC transport is written out in this package;
163
+ `@modelcontextprotocol/sdk` is a devDependency used only by the conformance test, which
164
+ drives this server with the reference client.
165
+
166
+ Verified against: the reference MCP client (full conformance suite) and Claude Code
167
+ (`✓ Connected`). Codex CLI accepts registration but its handshake is not independently
168
+ verified. Cursor and Continue are **not verified** — they speak the same protocol, and the
169
+ wire-level variations are pinned by test, but nobody has run them against this.
170
+
171
+ ## Security posture
172
+
173
+ - **Sensors execute by id only**, from a local registry you approve. An unregistered id is
174
+ refused and the refusal names what is allowed. There is no arbitrary-command path — not for
175
+ debugging, not temporarily.
176
+ - **The credential never lands in a file.** `init` records the *name* of the environment
177
+ variable to read (`GETTIER_DSN`), never its value.
178
+ - **Secrets are redacted before anything is persisted or transmitted.**
179
+ - **The endpoint never defaults to localhost.** A published package that did would post your
180
+ telemetry to a port on your own machine without telling you.
181
+
182
+ ## Documentation
183
+
184
+ - Quickstart — <https://docs.gettier.io/quickstart/>
185
+ - Full CLI reference — <https://docs.gettier.io/cli/>
186
+ - The worked demo, with a real model turn — <https://docs.gettier.io/demo/>
187
+ - The frozen contracts — <https://docs.gettier.io/contracts/>
188
+
189
+ Runtime observability for the deployed application is the other surface:
190
+ [`@gettier/node`](https://www.npmjs.com/package/@gettier/node).