@debonet/idd 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,133 @@
1
+ # Adopting IDD
2
+
3
+ Statement ids: complete
4
+
5
+ ## Purpose
6
+
7
+ What a project does to use interrogation-driven development, so that every
8
+ new session in it finds the shared question and answer files and uses its
9
+ tool's questionnaire with no further instruction.
10
+
11
+ ## His words
12
+
13
+ > {#m-f2so64} RULING (CEO) 2026-11-04: "We should consolidate all of the best
14
+ > practices/instructions/code for this interrogation-driven-development into
15
+ > a separate package so that many projects can use it. Stick it in ~/@idd and
16
+ > use the ConcordSTD framework. Your goal should be a package that can be
17
+ > included in AGENTS.md that makes a new session use the questionaire
18
+ > framework for pending questions"
19
+
20
+ > {#m-1g0dvt} RULING (CEO) 2026-11-04, q198. The question: "IDD: every
21
+ > project, or only projects that opt in? Your global Claude Code instructions
22
+ > already tell every session in every project to use a questions page. IDD
23
+ > is opted into by one line in a project's AGENTS.md. Example: a session in a
24
+ > project whose AGENTS.md lacks that line needs a decision from you.
25
+ > A) The global section becomes one pointer to IDD, so every project uses
26
+ > it.
27
+ > B) The global section is deleted; only projects with the IDD line use the
28
+ > page." His answer: B, with the note: "Just like Concord. Each project
29
+ > should specify whether or not they want to use each framework."
30
+
31
+ > {#m-o27vtp} RULING (CEO) 2026-11-04, q202 (Concord). The question: "Is
32
+ > ConcordSTC used by every project, or only by projects that say so?" His
33
+ > answer: A, only projects whose `AGENTS.md` says so, with the note: "The
34
+ > global claude should be set to ask if the user has not specified."
35
+
36
+ > {#m-wzc76j} RULING (CEO), 2026-11-06: "idd-merge-hook already uses node, so we have a node requirement. Just use npm."
37
+
38
+ > {#m-be8ix1} RULING (CEO), 2026-11-06: "the agent should open it for the
39
+ > user, or at least provide a link (frequently, because the page gets closed
40
+ > sometimes)"
41
+
42
+ > {#m-yqrzks} RULING (CEO), 2026-11-06, on keeping IDD data on branch-specific
43
+ > IDD branches and using a data worktree: "Agreed. Or do we provide a skill
44
+ > or direct cut and paste agent instructions?"
45
+
46
+ > {#m-0f7o0n} RULING (CEO), 2026-11-08: “So the instructions need to say
47
+ > to install the idd app on your project.”
48
+
49
+ ## Terms
50
+
51
+ * {#d-ihn44p <m-f2so64@36c95e2} **Adopting project** — a project whose root `AGENTS.md`
52
+ holds the IDD line.
53
+ * {#d-vl5tvf <m-f2so64@36c95e2} **IDD line** — the one line that includes IDD in an
54
+ adopting project's `AGENTS.md`.
55
+
56
+ ## The line
57
+
58
+ * {#g-4oj61n <m-wzc76j@812ba8b for=main,architect via=prompt} **Install the npm package.**
59
+ Add the public `@debonet/idd` package to the adopting project's npm
60
+ dependencies with `npm install @debonet/idd`.
61
+ * {#g-8m8doy <m-0f7o0n@0780303 for=main,architect via=prompt} **Install the GitHub App on
62
+ the repository.** Before expecting the viewer to discover a project's
63
+ questionnaire, include that repository in an installation of the IDD
64
+ GitHub App.
65
+ * {#g-6jkb7v <m-f2so64@36c95e2,m-wzc76j@812ba8b for=main,architect via=prompt} **One short copy-paste
66
+ instruction.** An adopting project's root `AGENTS.md` includes this text:
67
+
68
+ ```text
69
+ This project uses IDD. Before other work, read the installed package's instructions at the path printed by `node -p "require.resolve('@debonet/idd/INSTRUCTIONS.md')"`. If IDD is not installed, run `npm install @debonet/idd` first.
70
+ ```
71
+
72
+ * {#g-dpmdxo <m-yqrzks@7d9b3bc for=main,architect via=prompt} **Tool instructions use native
73
+ questionnaires.** The shared package documents the project workflow;
74
+ tool-specific guidance supplies only the mechanics of that agent's native
75
+ questionnaire and browser. A concise tool-specific instruction is
76
+ available for tools without skill support.
77
+ * {#g-0rz7vz <m-1g0dvt@dfb4edf for=main,architect via=prompt} **Per project, by its own
78
+ line.** A project uses IDD only when its own root `AGENTS.md` holds the
79
+ IDD line, as a project uses ConcordSTC only when it declares it; a
80
+ session in a project without the line follows none of IDD's rules.
81
+ * {#g-t4154n <m-1g0dvt@dfb4edf for=main,architect via=prompt} **Never for every project
82
+ at once.** IDD's rules, and any pointer to them, are never written into an
83
+ instruction file that sessions in every project read, as a user's global
84
+ `~/.claude/CLAUDE.md`.
85
+ * {#g-bl9a8z <m-o27vtp@5d340a6 for=main,architect via=prompt} **Ask when the project says
86
+ neither.** A user's global instruction file may hold one line telling a
87
+ session to ask the human whether to use a framework (IDD, ConcordSTC) in a
88
+ project whose root `AGENTS.md` says neither that it uses it nor that it
89
+ does not. That line holds none of IDD's rules and no pointer to them, so
90
+ Never for every project at once does not bar it.
91
+ * {#g-gkcg3x <m-o27vtp@5d340a6 for=main via=prompt} **His answer is written into the
92
+ project.** When he answers yes to IDD, the session writes the IDD line into
93
+ the project's root `AGENTS.md`; when he answers no, it writes there, on a
94
+ line of its own, exactly `This project does not use IDD.`; either line
95
+ means the project is never asked again. Until he answers, the session
96
+ follows none of IDD's rules.
97
+ * {#g-sbu6iu <arch for=main via=prompt} **Asked in the terminal.** The question
98
+ whether to use IDD is asked in the terminal, since a project that has not
99
+ adopted IDD has no questions page.
100
+ * {#g-0pni9q <m-f2so64@36c95e2 for=main,architect via=prompt} **Nothing copied.** An
101
+ adopting project's rules files and specs hold no copy of IDD's rules;
102
+ they hold the IDD line and the project's own standing principles, which
103
+ IDD's checks read (`specs/guidance/writing-questions.md`, Before it is
104
+ asked).
105
+ * {#g-ze1gq8 <m-f2so64@36c95e2 for=main via=prompt} **Its files.** An adopting project
106
+ holds its page file and question file, and its answer and pending answer
107
+ files once answers are recorded (`specs/project-files.md`); the first session that finds the
108
+ page file and question file absent creates them
109
+ (`specs/guidance/session.md`, Starting a session).
110
+
111
+ ## IDD's own files, read from other projects
112
+
113
+ * {#g-suwilu <m-f2so64@36c95e2 for=main,architect via=prompt} **Tool mechanics apart.**
114
+ The installed IDD guidance holds the shared project workflow; a skill may
115
+ add only the mechanics of one agent tool's questionnaire or browser.
116
+
117
+ ## Migrating a project with an existing page
118
+
119
+ * {#g-ze1mh5 <m-f2so64@36c95e2 for=main via=prompt} **Follow the migration note.** A
120
+ project that already has a questions page made from the older template,
121
+ or rules of its own on questions for the human, adopts IDD by
122
+ `~/@idd/docs/existing-page-migration.md`, which keeps the page's address
123
+ and every saved answer.
124
+
125
+ * {#s-fm0j9h <m-0f7o0n@0780303} The package instructions tell adopters to
126
+ install the IDD GitHub App on each project repository and link to its
127
+ installation page.
128
+
129
+ ## Dependencies
130
+
131
+ * {#p-e3n6ry >specs/project-files.md} The IDD data worktree and files an adopting project holds.
132
+ * {#p-zrzy09 >specs/guidance/session.md} What a session in an adopting project
133
+ does first.
package/specs/build.md ADDED
@@ -0,0 +1,176 @@
1
+ # Build, Layout, and Run
2
+
3
+ Statement ids: complete
4
+
5
+ ## Purpose
6
+
7
+ IDD's toolchain, layout, dependencies and the named commands every fixer
8
+ invokes; no fixer runs `node`, `jest` or an ad-hoc pipeline outside these.
9
+
10
+ ## Toolchain
11
+
12
+ * {#g-94bsyg <arch for=main,architect,fixer via=prompt} Use Node >= 20 and plain
13
+ JavaScript with CommonJS modules (`require` / `module.exports`) for the
14
+ command and its modules; do not add TypeScript, ESM or a bundler.
15
+ * {#g-d4bbao <arch for=main,architect,fixer via=prompt} Keep Jest at major version
16
+ 29, and test the page in a DOM emulated by `jsdom`, with the page's store
17
+ and comment services replaced by fakes the test controls.
18
+ * {#g-kv15zk <arch for=main,architect,fixer via=prompt} Keep this an
19
+ interpreted-language project. Developers install its dependencies with
20
+ `npm install`; adopters add the public package to their project with
21
+ `npm install @debonet/idd`.
22
+
23
+ ## Project Layout
24
+
25
+ ```
26
+ ~/@idd
27
+ package.json agent package metadata and project scripts
28
+ package-lock.json committed
29
+ README.md
30
+ INSTRUCTIONS.md canonical agent workflow installed with npm
31
+ AGENTS.md what a session in an adopting project follows
32
+ (specs/adoption.md)
33
+ CLAUDE.md imports AGENTS.md for sessions in this repository
34
+ concord.json IDD's Concord declaration
35
+ observations.md IDD's observations
36
+ idd/ IDD's own page, question, answer and pending
37
+ answer files (specs/project-files.md)
38
+ bin/ the command: idd
39
+ and the merge-hook installer
40
+ scripts/ the modules behind the command
41
+ templates/ the questions page template
42
+ .githooks/ IDD and Concord Git hooks
43
+ web/ Cloud Run viewer, OAuth callback and workspace package
44
+ web/package.json hosted service runtime dependencies
45
+ Dockerfile Cloud Run container
46
+ docs/ migration notes for adopting projects
47
+ specs/ IDD's specs; specs/guidance/ the session rules
48
+ test/ IDD's jest tests
49
+ .githooks/pre-commit IDD's pre-commit hook (Concord's gate)
50
+ tmp/ scratch and fixture trees (gitignored)
51
+ ```
52
+
53
+ * {#g-dt9a19 <arch for=main,architect,fixer via=prompt} Keep `node_modules/` and
54
+ `tmp/` gitignored.
55
+
56
+ ## Hosted viewer
57
+
58
+ * {#g-tskk4b <arch for=main,architect,fixer via=prompt} Keep the hosted viewer in
59
+ `web/` and implement its HTTP service with Node's built-in modules; the
60
+ service listens on `process.env.PORT` and serves files from `web/`.
61
+ * {#g-b9fjxa <arch for=main,architect,fixer via=prompt} The service requires
62
+ `GITHUB_APP_CLIENT_ID`, `GITHUB_APP_CLIENT_SECRET`, and
63
+ `IDD_OAUTH_STATE_SECRET`, and the public origin in `IDD_PUBLIC_URL`;
64
+ production supplies the client secret and state secret from Google Secret
65
+ Manager.
66
+ * {#g-xutz05 <arch for=main,architect,fixer via=prompt} The service uses
67
+ `@google-cloud/firestore` to retain MCP event subscriptions across Cloud Run
68
+ restarts; production supplies a Firestore database and grants the Cloud Run
69
+ service account Firestore read/write access.
70
+ * {#g-u68buh <arch for=main,architect,fixer via=prompt} Keep
71
+ `@google-cloud/firestore` and `standardwebhooks` in the hosted workspace's
72
+ runtime dependencies and
73
+ keep every external request used by MCP event delivery injectable for
74
+ hermetic tests.
75
+ * {#g-hq4lnx <arch for=main,architect,fixer via=prompt} Run the service locally
76
+ with `npm start`; the root `Dockerfile` installs runtime dependencies from
77
+ `package-lock.json` before starting the Cloud Run service.
78
+ * {#g-otococ <arch for=main,architect,fixer via=prompt} Keep the GitHub App
79
+ configuration and Cloud Run deployment steps in `docs/hosted-viewer.md`;
80
+ do not commit credentials.
81
+ * {#s-gu3zl2 <arch} `npm run deploy` runs `scripts/deploy.js` to deploy the
82
+ root Dockerfile to Cloud Run service `idd-service` in project `idd-platform`
83
+ and region `us-east4`, with one maximum instance and concurrency 1000.
84
+ It uses the authenticated `gcloud` CLI and leaves the service's existing
85
+ environment variables, secret bindings, and access policy in place.
86
+ * {#s-emm7r0 <arch} The deployment script reports a missing `gcloud`
87
+ executable or a failed deployment with a nonzero exit status and does not
88
+ print credentials or secret values.
89
+ * {#g-hfipex <arch for=main,architect,fixer via=prompt} The hosted MCP endpoint is
90
+ `/mcp`; implement its Streamable HTTP tools and events protocol with Node
91
+ built-ins and use `standardwebhooks` for signed callbacks. Keep callback
92
+ network validation, signing, retries and subscription storage behind
93
+ modules with hermetic tests.
94
+ * {#g-ami8kh <arch for=main,architect,fixer via=prompt} Keep the canonical
95
+ adopter workflow in root `INSTRUCTIONS.md`; `idd guide` prints that
96
+ file verbatim, and npm installs it with the package.
97
+ * {#g-w20g67 <arch for=main,architect,fixer via=prompt} Expose `idd-merge-hook` from
98
+ `bin/idd-merge-hook`; its installer writes hooks to the adopting project's
99
+ `.githooks/` and configures Git to run them; each hook calls the installed
100
+ package with `npm exec -- idd-merge-hook` (`specs/idd-merge-hook.md`).
101
+
102
+ ## The command
103
+
104
+ * {#s-cg2j10 <arch} `bin/idd` is executable, has no file extension, and opens
105
+ with the line `#!/usr/bin/env node`, so it runs by its path from any
106
+ working directory (`specs/idd-page.md`).
107
+ * {#s-vfgnzf <arch} It loads every npm module it uses from IDD's own
108
+ dependencies, never from the adopting project's.
109
+
110
+ ## Packages and Dependencies
111
+
112
+ > {#m-47zf2p} RULING (CEO), 2026-11-12: “we need two different things:
113
+ > 1) the idd back end, which runs in interrogation.dev
114
+ > 2) the idd instructions and tools which live in npm”
115
+
116
+ * {#s-nifxq3 <m-47zf2p@5c93368} The published npm package contains the agent command, its required modules,
117
+ templates, specifications and canonical instructions; it excludes the hosted
118
+ web application, its runtime dependencies, Dockerfile and Cloud Run deployment
119
+ script. The hosted service has a separate workspace manifest and is deployed
120
+ from the IDD repository; it is reached at `https://interrogation.dev`.
121
+ * {#g-aiemo2 <arch for=main,architect,fixer via=prompt} Publish the package
122
+ publicly as `@debonet/idd`, exposing `idd` and `idd-merge-hook` from
123
+ their matching files under `bin/`, so adopters can install it from npm.
124
+ * {#g-7o7fu3 <arch for=main,architect,fixer via=prompt} Keep every module the
125
+ command loads in `dependencies`, and Jest `^29`, `jsdom` and other
126
+ test-only modules in `devDependencies`.
127
+ * {#g-haeoa5 <arch for=main,architect,fixer via=prompt} Set the scripts: `"start"`
128
+ to `"node web/server.js"`; `"test"` to `"jest"`; `"spec-map"` to
129
+ `"$HOME/@concord/bin/spec-map"`;
130
+ `"spec-coverage"` to `"$HOME/@concord/bin/spec-coverage"`;
131
+ `"hook-install"` to `"$HOME/@concord/bin/concord-hook install"`; each
132
+ passes its arguments through unchanged and in order.
133
+ * {#g-5phruy <arch for=main,architect,fixer via=prompt} Set Jest's root to
134
+ `<rootDir>/test`.
135
+
136
+ ## Build and Test
137
+
138
+ * {#g-2avaz9 <arch for=main,architect,fixer via=prompt} Install dependencies with
139
+ `npm install --cache ./tmp/npm-cache` at `~/@idd`.
140
+ * {#g-6gajca <arch for=main,architect,fixer via=prompt} Run the suite with
141
+ `npm test` at `~/@idd`; add tests under `test/**/*.test.js`.
142
+ * {#g-va67x1 <arch for=main,architect,fixer via=prompt} Check the specs and links
143
+ with `npm run spec-map [-- <arguments>]` (assign: `npm run spec-map --
144
+ --assign`; hash table: `npm run --silent spec-map -- --hashes`); measure
145
+ coverage with `npm run spec-coverage [-- <arguments>]` on demand, never as
146
+ part of `npm test`.
147
+ * {#g-fj4oz8 <arch for=main,architect,fixer via=prompt} Keep commits gated by
148
+ `.githooks/pre-commit`, installed in each clone with
149
+ `npm run hook-install` once `npm run spec-map -- --gate` passes over the
150
+ tree.
151
+
152
+ ## IDD's own settings
153
+
154
+ * {#g-g10hm9 <arch for=main,architect,fixer via=prompt} Declare in `concord.json`
155
+ IDD's name `IDD`, its one suite `root` over `test`, its languages
156
+ `javascript`, `html` and `css`, its read directories `bin`, `scripts`,
157
+ `templates`, `test` and `web`, the ignored directory `node_modules`, the record
158
+ file `test/interactive-passes.jsonl`, the observations file
159
+ `observations.md`, the rules files `AGENTS.md` and `CLAUDE.md`, and one
160
+ coverage run at the root over `bin` and `scripts` with the review file
161
+ `spec-coverage-review.md`; include `web` in the coverage sources and keep
162
+ those values aligned with this spec.
163
+
164
+ ## Hermeticity
165
+
166
+ * {#g-qq5g54 <arch for=fixer via=prompt} Keep tests hermetic: do not write outside
167
+ the project's `tmp/`, read files outside the project, open network
168
+ connections or run `git`; build each fixture project under `tmp/` and run
169
+ the command with that fixture as its working directory.
170
+ * {#g-grm59h <arch for=fixer via=prompt} Tests do not read files under `specs/`
171
+ or `idd/`; build the files a case needs in its fixture.
172
+
173
+ ## Error Handling
174
+
175
+ * {#s-ddc95k <arch} The command's errors reach its caller as its exit code and
176
+ stderr lines, as `specs/idd-page.md` gives them.
@@ -0,0 +1,63 @@
1
+ # Guidance: IDD-aware branch merges
2
+
3
+ ## His words
4
+
5
+ > {#m-mc5vkw} RULING (CEO) 2026-11-05: “So the merge for idd can
6
+ > involve creating new questions and deleting the duplicates and then doing
7
+ > the work required to implement the decision.”
8
+
9
+ ## Merge process
10
+
11
+ * {#g-rt5s9p <m-mc5vkw@076749d for=main,architect,fixer via=prompt} Before an agent completes a code-branch merge, it
12
+ compares the source and target IDD branches and reviews questions and
13
+ answers that may describe the same decision.
14
+ * {#g-k07zt5 <arch for=main,architect,fixer via=prompt} Exact duplicate questions are consolidated into one active
15
+ question; earlier question and answer records remain in the IDD history
16
+ and point to the consolidated question.
17
+ * {#g-8ux1b9 <arch for=main,architect,fixer via=prompt} When the same question id has
18
+ different accepted answers on the source and target IDD branches, the
19
+ target answer remains accepted and the source answer is recorded as a
20
+ rejected answer conflict with its submitting GitHub user.
21
+ * {#g-9p1iiw <arch for=main,architect,fixer via=prompt} When questions describe the same decision but their answers
22
+ do not settle it, the agent adds one clarifying question to the target
23
+ IDD branch, then waits for its answer before doing the implementation
24
+ work and completing the code-branch merge.
25
+ * {#g-wjcjlc <arch for=main,architect,fixer via=prompt} When a follow-up question makes an earlier question obsolete,
26
+ the agent archives it with `npm exec -- idd archive <old-id> <follow-up-id>`;
27
+ its full question record and answer remain in history.
28
+ * {#g-y1uuo7 <arch for=main,architect,fixer via=prompt} During reconciliation, keep the target
29
+ page's branch hash and each retained question's origin branch hash; a new
30
+ clarifying question gets the target branch hash.
31
+ * {#g-gn96qw <arch for=main,architect,fixer via=prompt} An agent may use this process without ConcordSTC.
32
+
33
+ ## Git integration
34
+
35
+ * {#g-3fmwel <arch for=main,architect,fixer via=prompt} Every code-branch merge uses
36
+ `git merge --no-ff` so Git runs the IDD pre-merge hook.
37
+ * {#g-tu3fn2 <arch for=main,architect,fixer via=prompt} Each clone installs the IDD hooks
38
+ with `npm exec -- idd-merge-hook install`; the project's `.githooks/` files
39
+ are committed, and the session checks installation before merging.
40
+ * {#g-1b9rc2 <arch for=main,architect,fixer via=prompt} The committed `pre-merge-commit` hook asks the IDD merge
41
+ command to check for unresolved questionnaire conflicts before Git
42
+ creates a merge commit.
43
+ * {#g-qzhgum <arch for=main,architect,fixer via=prompt} When Git first stops for code conflicts, the `pre-commit`
44
+ hook performs the same check before the agent commits the resolved merge.
45
+ * {#g-uhed71 <arch for=main,architect,fixer via=prompt} A hook that finds unresolved IDD work exits unsuccessfully and
46
+ prints the source and target branches and the IDD reconciliation
47
+ command for the agent to continue the process.
48
+ * {#g-qi307t <arch for=main,architect,fixer via=prompt} When the agent finds related questions that do
49
+ not require a clarifying answer, it records its review with
50
+ `npm exec -- idd-merge-hook reviewed`; the confirmation is tied to the current source
51
+ and target commits and cannot authorize a later merge state. The source IDD
52
+ branch must already be merged into and reconciled on the target IDD branch.
53
+ * {#g-xvyj2c <arch for=main,architect,fixer via=prompt} The agent does not record a review while
54
+ duplicate, obsolete or conflicting questions remain unresolved, or while
55
+ a clarifying answer or its implementation is pending.
56
+ * {#g-lwnark <arch for=main,architect,fixer via=prompt} Before completing the code merge, the agent merges the
57
+ source IDD branch into the target IDD branch, reconciles and commits the
58
+ result, and pushes the target IDD branch. The `post-merge` hook verifies
59
+ that the reviewed IDD state remains in place and clears the review record.
60
+
61
+ ## Dependencies
62
+
63
+ * {#p-afnv8o >specs/hosted-questionnaire.md} The IDD branch data and its reconciliation rules.
@@ -0,0 +1,108 @@
1
+ # Guidance: reading and recording the human's answers
2
+
3
+ Statement ids: complete
4
+
5
+ ## Purpose
6
+
7
+ How the session reads an answer from the page, replies to it, and records
8
+ it as a ruling where the project's agents will find it. Each `[o-…]`
9
+ citation names an entry of `~/@idd/observations.md`.
10
+
11
+ ## His words
12
+
13
+ > {#m-s43qto} From his instructions file `~/.claude/CLAUDE.md`, section
14
+ > "Questions for me go on a web questions page", as read 2026-11-04:
15
+ > "**Handling my answers:** when a comment arrives (an auto-reply or "sent to
16
+ > Claude"), read the thread, act on the answer, reply in the thread only if
17
+ > the auto-reply didn't already cover it, resolve the thread, and write one
18
+ > line in the session. If my answer includes a note, the note refines the
19
+ > option; read both together. If the note leaves the choice ambiguous, add a
20
+ > follow-up question to the page."
21
+
22
+ > {#m-yo3wtj} RULING (CEO) (AIOS), after a pointer answer ("I answered this
23
+ > in 97") was read as one of the question's options: "NO. This is not what I
24
+ > said."
25
+
26
+ > {#m-gcnebt} RULING (CEO) (AIOS), after a note naming a tab was re-asked
27
+ > as ambiguous: "OMG. You're making this complicated."
28
+
29
+ > {#m-bbat3q} RULING (CEO) 2026-09-30 (AIOS), asked back about slips in his
30
+ > answer: "Its frustrating repeating myself multiple times on the same topic
31
+ > ... you learn to listen the first time"
32
+
33
+ > {#m-mbhrcu} RULING (CEO) (AIOS) 2026-09-28: "why are you putting my
34
+ > decisions into claude.md instead of the architect putting them into spec/
35
+ > files?"; 2026-10-01: "why are you copying all of my sentences to a cdeo
36
+ > file?"; 2026-10-08: "Those are product specifications. They belong in the
37
+ > appropriate spec/ file(s)"
38
+
39
+ > {#m-a7o9fh} RULING (CEO) (AIOS), after a gloss of his ruling added a
40
+ > limit: "I never said a parent only limits its direct children."
41
+
42
+ ## When an answer arrives
43
+
44
+ * {#g-y2queb <m-s43qto@adbad2e for=main via=prompt} **The thread.** When a page comment
45
+ arrives, an automatic reply's notice included, or he says "done" or
46
+ "updated": read the thread, act on the answer, reply in the thread only if
47
+ the automatic reply did not already cover it, resolve the thread, and
48
+ write one line in the session.
49
+ * {#g-c7bap6 <m-s43qto@adbad2e for=main via=prompt} **The automatic reply speaks for the
50
+ session.** Compare every automatic reply with the chosen option's own text
51
+ in the question file; where it assumed, defaulted or promised anything the
52
+ option does not say, reply with the correction before resolving.
53
+ [o-8rmpk8]
54
+ * {#g-1499zt <arch for=main via=prompt} **A note cut off mid-sentence.** When a
55
+ note ends mid-sentence, read the question's `answers/` document for the
56
+ latest text before acting, and act only on a note that ends cleanly.
57
+
58
+ ## Reading an answer
59
+
60
+ * {#g-btj8e4 <m-s43qto@adbad2e for=main via=prompt} **The note refines the option.**
61
+ Read the chosen option and the note together; when the note leaves the
62
+ choice ambiguous, add and present a follow-up with the current tool's
63
+ questionnaire (`specs/guidance/session.md`).
64
+ * {#g-jigpd2 <m-yo3wtj@e906838 for=main via=prompt} **A pointer is not an option.** An
65
+ answer that points elsewhere ("I answered this in 97"), or a note with no
66
+ option, is never mapped onto one of the question's options; unless the
67
+ pointed-to answer's options literally cover this question's case, the
68
+ question goes back through the current tool's questionnaire as a new
69
+ question quoting his note, and the
70
+ thread reply says so. No reading of it is relayed to an architect.
71
+ [o-65eyze]
72
+ * {#g-7h9l11 <m-gcnebt@f88839e for=main via=prompt} **His nouns name what he sees.**
73
+ A noun in his note that names a visible part of the thing the question
74
+ shows, a tab, a view or a field, means that part; read it so before
75
+ calling the note ambiguous. [o-8qre78]
76
+ * {#g-0wfhwz <m-bbat3q@8bd203e for=main via=prompt} **A typo is read as its intent.** An
77
+ evident typo in his answer is read as its evident intent when exactly one
78
+ reading fits his earlier rulings and the project's vocabulary: act on it
79
+ and mention the correction in one clause; ask only when two readings
80
+ would build different things.
81
+
82
+ ## Recording a ruling
83
+
84
+ * {#g-q5375r <m-mbhrcu@1ffe48c for=main,architect via=prompt} **Into the specs, through the
85
+ architect.** His answer reaches the project's rules only through the spec
86
+ that owns its subject: the main thread pastes his answer and the question
87
+ it answered verbatim into an architect's brief, and the architect records
88
+ them in that spec as a motive line, `RULING (CEO) <date>, q<N>:` and his
89
+ words, then writes each conclusion as its own statement rooted in it. His
90
+ decision is never written into a rules file or a scratch file.
91
+ * {#g-zvulrj <arch for=main,architect via=prompt} **Dated from the clock.** The date
92
+ on a recorded ruling is taken from `date` run in the same turn, never from
93
+ memory.
94
+ * {#g-p37e2s <m-a7o9fh@11c5476 for=main,architect via=prompt} **A gloss adds nothing.**
95
+ A sentence that restates a ruling of his carries his quoted words beside
96
+ it and adds no limit he did not state; before relaying a limit on a
97
+ ruling, find it in his words (`grep -rn "<the limit's words>" specs/ |
98
+ grep "{#m-"`) or do not relay it. [o-a1t5mg]
99
+ * {#g-7x0l5s <arch for=main via=prompt} **Citing his rulings.** Before saying
100
+ something rests on a ruling of his, find his quoted words and read the
101
+ question they answered; a ruling that cannot be found is an architect's
102
+ decision and goes to him as a question, never as a default.
103
+
104
+ ## Dependencies
105
+
106
+ * {#p-hd5c3l >specs/questions-page.md} The Done comment and the answer documents.
107
+ * {#p-nbpmws >specs/guidance/session.md} The pending queue an incorporated answer
108
+ is cleared from.
@@ -0,0 +1,76 @@
1
+ # Guidance: the questions page in Claude Code
2
+
3
+ Statement ids: complete
4
+
5
+ ## Purpose
6
+
7
+ The Claude Code tools that carry out the steps of
8
+ `specs/guidance/session.md` and `specs/guidance/answers.md`: publishing the
9
+ page, reading and clearing its store, recording its answers in the
10
+ project's answer file, and handling its comment threads.
11
+ Each `[o-…]` citation names an entry of `~/@idd/observations.md`.
12
+
13
+ ## His words
14
+
15
+ > {#m-ceg9ie} From his instructions file `~/.claude/CLAUDE.md`, section
16
+ > "Questions for me go on a web questions page", as read 2026-11-04:
17
+ > "**Publish with the Artifact tool, with `capabilities: {comments: {}, db:
18
+ > {}, user: {}}`.**"
19
+
20
+ > {#m-p8am7s} From the same section: "republish to the same URL, and open the
21
+ > page in my local Chrome (`mcp__claude-in-chrome__navigate`)."
22
+
23
+ > {#m-2nhxvl} From the same section: "**If my answers stop reaching you**
24
+ > (I say "updated", or a notice says a comment is awaiting a reply), read the
25
+ > page's comments yourself with `ArtifactComments` action "comments" and act
26
+ > on every comment of mine marked "sent to you". Do this also before going
27
+ > idle while questions are open. Auto mode's permission check can block the
28
+ > automatic reply that would have woken you; the answer still sits in the
29
+ > thread."
30
+
31
+ ## Publishing
32
+
33
+ * {#g-g4nbtw <m-ceg9ie@e62db2e for=main via=prompt} **Publish the built page.** Publish
34
+ `tmp/idd/page.html` with the Artifact tool and the capabilities `comments`,
35
+ `db` and `user`. On the first publish, write the address the tool returns
36
+ into the page file's `url`; every later publish updates the artifact at
37
+ that address, never a new one.
38
+ * {#g-k3cqou <m-p8am7s@e496a8d for=main via=prompt} **Open it for him.** After every
39
+ publish, open the page's `url` in his local Chrome with
40
+ `mcp__claude-in-chrome__navigate`, screenshot the new card, and check its
41
+ options are drawn.
42
+
43
+ ## The store
44
+
45
+ * {#g-x76kn8 <arch for=main via=prompt} **Pending answers.** List the page's
46
+ pending answers with ArtifactData `list` on `pending`; read one with
47
+ `get` on `pending/<id>`, noting its version; clear it with `delete` on
48
+ `pending/<id>` pinned with `if_version` to that version.
49
+ * {#g-2jje15 <arch for=main via=prompt} **Saved answers.** Read a saved answer
50
+ with ArtifactData `get` on `answers/<id>`; its `sChoice` is the chosen
51
+ option's key and its `sNote` his note (`specs/questions-page.md`, API).
52
+ * {#g-oauw82 <arch for=main via=prompt} **Recording an answer.** The page's
53
+ store is where his answers reach the session, and the answer file is
54
+ their record. To record a pending answer, read `answers/<id>` with
55
+ ArtifactData `get` and pass its value, the object holding `sChoice`,
56
+ `sNote` and `dtm`, on stdin to `npm exec -- idd answer <id>` through
57
+ a heredoc with a quoted delimiter, so his note reaches it unchanged; it
58
+ must exit 0 before the answer is acted on.
59
+ * {#g-u09697 <arch for=main via=prompt} **The local queue.** `idd answer` also records
60
+ each page answer in `idd/pending.json`. After incorporating it, clear the
61
+ local entry with `idd clear-pending <id> <time>`, using the `dtm`
62
+ just recorded. At session start, also act on local pending answers that
63
+ have no matching page-store entry, as `specs/guidance/session.md` gives.
64
+
65
+ ## Comment threads
66
+
67
+ * {#g-ckcyd7 <arch for=main via=prompt} **On every automatic-reply notice.** On an
68
+ `artifact-auto-react` notice, read the thread with ArtifactComments,
69
+ compare the reply with the option's text (`grep -n -A8 '"id": "q<N>"'
70
+ idd/questions.json`), reply with any correction, then resolve it.
71
+ [o-8rmpk8]
72
+ * {#g-liax1o <m-2nhxvl@6923e6a for=main via=prompt} **When answers stop reaching the
73
+ session.** When he says "updated", when a notice says a comment is
74
+ awaiting a reply, and before going idle while questions are open, read
75
+ the page's comments with ArtifactComments action `comments` and act on
76
+ every comment of his marked "sent to you".
@@ -0,0 +1,85 @@
1
+ # Guidance: questions in Codex
2
+
3
+ Statement ids: complete
4
+
5
+ ## Purpose
6
+
7
+ How a Codex session asks a question, captures the human's answer in the
8
+ project's shared files, and carries an answer across sessions until it is
9
+ incorporated. Each `[o-…]` citation names an entry of
10
+ `~/@idd/observations.md`.
11
+
12
+ ## His words
13
+
14
+ > {#m-zbztp6} From this session, as read 2026-11-04: "Right, so the purpose of
15
+ > this session is to add codex specific support for @idd"
16
+
17
+ ## Asking
18
+
19
+ * {#g-p0f582 <m-zbztp6@c44613a for=main via=prompt} **Add to the shared question list.** Before presenting a
20
+ question to the human, add it to `idd/questions.json` in the matching IDD
21
+ data worktree with `npm exec -- idd add`, following
22
+ `specs/guidance/writing-questions.md`.
23
+ * {#g-az3d5j <m-edvy4l@54198de,m-zbztp6@c44613a for=main via=prompt} **Use Codex's questionnaire.** Present one complete
24
+ question with `functions.request_user_input_async`. Put the title and body
25
+ together in its `title` field, and pass every option as a choice string
26
+ beginning with its key and followed by its text.
27
+ * {#g-hh957h <m-be8ix1@1bb0e96 for=main via=prompt} **Use the hosted questionnaire as a
28
+ fallback.** If Codex's interactive questionnaire tool is unavailable,
29
+ publish the question to the matching IDD branch and provide its direct
30
+ hosted viewer link; do not ask the decision only in terminal text.
31
+
32
+ ## Capturing an answer
33
+
34
+ * {#g-7x2hqd <m-edvy4l@54198de for=main via=prompt} **Save the result locally.** When the human answers in
35
+ Codex's questionnaire, pass the chosen option key, note and save time to
36
+ `npm exec -- idd answer <id>` in the form its specification requires.
37
+ A tapped option is that choice with an empty note. For free text beginning
38
+ with an exact option key followed by ` — ` or `: `, use that key as the
39
+ choice and the remaining text as the note. For other free text, use an
40
+ empty choice and the full text as the note.
41
+ * {#g-94d4e1 <arch for=main via=prompt} **Record before acting.** The `answer` command records
42
+ the answer in `idd/answers.json` and `idd/pending.json`; only after it
43
+ exits successfully does the session act on the answer, by
44
+ `specs/guidance/answers.md`.
45
+
46
+ ## Starting a session
47
+
48
+ * {#g-vqum6f <arch for=main via=prompt} **Read the local queue.** At the start of a Codex
49
+ session, read `idd/pending.json` when it exists. Act on each pending
50
+ answer before the task the session was started for, following
51
+ `specs/guidance/session.md` and `specs/guidance/answers.md`.
52
+ * {#g-u0m8hp <arch for=main via=prompt} **Clear after incorporation.** After incorporating a
53
+ pending answer, clear it with `npm exec -- idd clear-pending <id>
54
+ <time>`, using the `time` read from that pending entry. A changed answer
55
+ with a different time stays pending.
56
+ * {#g-vuueha <arch for=main via=prompt} **Refresh hosted answers.** Before saying a hosted
57
+ question is still unanswered, and at the start of a session that has
58
+ hosted questions, fetch its `idd-<branch>` branch in the data worktree and
59
+ read the latest `idd/answers.json`; a stale local copy is not evidence that
60
+ an answer is still pending.
61
+ * {#g-f73yzy <arch for=main via=prompt} **Publish from the agent.** After adding or changing
62
+ a hosted question, commit its `idd/` files to the matching IDD data branch
63
+ and push that branch to the same GitHub repository; pushing the branch
64
+ makes the project appear in the user's viewer. Obtain the page link with
65
+ `npm exec -- idd viewer-url <owner/repository> <code-branch>`; open it when the
66
+ session can open a browser and repeat the link in progress updates while
67
+ questions remain unanswered.
68
+ * {#g-7beaaa <arch for=main via=prompt} **Record a fetched answer locally.** For each newly
69
+ fetched hosted answer, pass its `choice`, `note` and `time` as `sChoice`,
70
+ `sNote` and `dtm` to `npm exec -- idd answer <id>`; incorporate it and clear the
71
+ resulting local pending entry by `specs/guidance/session.md` before
72
+ reporting the question as handled.
73
+ * {#g-rczwav <arch for=main via=prompt} **Publish hosted agent status.** Work in a
74
+ separate data worktree checked out at the matching `idd-<branch>` branch. Use
75
+ `npm exec -- idd status <session-id> blocked` only when a human answer is the sole
76
+ thing preventing progress; use `working` as soon as work can proceed, and
77
+ `clear` before ending the session. Commit and push each status change so
78
+ the viewer can show it.
79
+
80
+ ## Dependencies
81
+
82
+ * {#p-uonp7o >specs/project-files.md} The shared question, answer and pending answer files.
83
+ * {#p-4v8nei >specs/idd-page.md} The command that records and clears pending answers.
84
+ * {#p-nulz3q >specs/guidance/writing-questions.md} The shared rules for writing a question.
85
+ * {#p-e4c7xe >specs/guidance/answers.md} The shared rules for reading and incorporating an answer.