@dogfood-lab/study-swarm 1.3.0 → 2.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.
- package/CHANGELOG.md +61 -0
- package/PROTOCOL.md +5 -5
- package/README.es.md +18 -11
- package/README.fr.md +23 -16
- package/README.hi.md +19 -12
- package/README.it.md +25 -18
- package/README.ja.md +23 -16
- package/README.md +15 -8
- package/README.pt-BR.md +18 -11
- package/README.zh.md +19 -12
- package/SECURITY.md +6 -5
- package/bin/study-swarm.mjs +631 -87
- package/examples/study-swarm-canon-rollback.dispatch.md +8 -9
- package/examples/study-swarm-canon-rollback.lock.json +20 -20
- package/examples/study-swarm-ci.yml +3 -2
- package/examples/study-swarm-lock.dispatch.md +12 -12
- package/examples/study-swarm-lock.lock.json +15 -15
- package/examples/study-swarm-v1_1.dispatch.md +1 -1
- package/package.json +1 -1
package/README.it.md
CHANGED
|
@@ -23,18 +23,18 @@ Applica la propria "medicina". Il protocollo prevede l'utilizzo di verificatori
|
|
|
23
23
|
|
|
24
24
|
1. **Identificare** 3-5 domande progettuali fondamentali su cui le prove empiriche potrebbero cambiare la risposta.
|
|
25
25
|
2. **Attivare** un agente di ricerca per ogni domanda, in parallelo. Ognuno deve restituire titoli degli articoli + autori + anni + URL + una breve sintesi (una frase) — dare priorità alla specificità rispetto all'ampiezza ("6-8 risultati ben documentati sono meglio di 20 affermazioni vaghe").
|
|
26
|
-
3. **Sintetizzare** i risultati in una sezione "
|
|
27
|
-
4. **Verificare esternamente** — una *famiglia di modelli diversa*,
|
|
26
|
+
3. **Sintetizzare** i risultati in una sezione "Research grounding" (fondamento della ricerca): `N. **<risultato>.** <Autori> <anno> (<arXiv/DOI>). <implicazione progettuale>.`
|
|
27
|
+
4. **Verificare esternamente** — una *famiglia di modelli diversa*, con il ragionamento del generatore nascosto, controlla ogni citazione in due fasi: un **oracolo di recupero** conferma che l'articolo esiste (non si basa mai sulla memoria del modello), quindi una "lente di fondatezza" verifica che il risultato corrisponda alla fonte. **Scartare** un risultato fabbricato; **correggere un'attribuzione errata una volta** e riverificare (un secondo verdetto non pulito lo scarta). **Interrompere e segnalare** solo se il verificatore o l'oracolo di recupero non sono disponibili (non interpretare mai l'assenza come "le citazioni sono corrette").
|
|
28
28
|
5. **Collegare** ogni scelta architettonica a un risultato specifico, tramite numero. Le citazioni prive di implicazioni progettuali sono rumore.
|
|
29
29
|
|
|
30
30
|
I dettagli completi e eseguibili — la tabella di interruzione, lo standard per le fonti, la regola dell'insieme — si trovano in **[PROTOCOL.md](PROTOCOL.md)**.
|
|
31
31
|
|
|
32
|
-
## Perché una *famiglia diversa*,
|
|
32
|
+
## Perché una *famiglia diversa*, con il ragionamento del generatore nascosto?
|
|
33
33
|
|
|
34
34
|
Perché i modi di errore sono documentati, non ipotetici:
|
|
35
35
|
|
|
36
36
|
- **Gli LLM non possono verificare in modo affidabile i propri risultati.** Huang et al. 2023 ([arXiv:2310.01798](https://arxiv.org/abs/2310.01798)); Kambhampati et al. 2024 ([arXiv:2402.01817](https://arxiv.org/abs/2402.01817), LLM-Modulo); Stechly et al. 2024 ([arXiv:2402.08115](https://arxiv.org/abs/2402.08115)) — il verificatore esterno offre i vantaggi; l'autovalutazione è inerte.
|
|
37
|
-
- **I giudici della stessa famiglia tendono a favorire se stessi.** Panickssery, Bowman & Feng 2024 ([arXiv:2404.13076](https://arxiv.org/abs/2404.13076)) — l'autoriconoscimento è correlato *linearmente* all'autopreferenza, quindi un'occlusione parziale non aiuta. Verga et al. 2024 ([arXiv:2404.18796](https://arxiv.org/abs/2404.18796), PoLL) — un gruppo di esperti provenienti da famiglie diverse è meno influenzato,
|
|
37
|
+
- **I giudici della stessa famiglia tendono a favorire se stessi.** Panickssery, Bowman & Feng 2024 ([arXiv:2404.13076](https://arxiv.org/abs/2404.13076)) — l'autoriconoscimento è correlato *linearmente* all'autopreferenza, quindi un'occlusione parziale non aiuta. Verga et al. 2024 ([arXiv:2404.18796](https://arxiv.org/abs/2404.18796), PoLL) — un gruppo di esperti provenienti da famiglie diverse è meno influenzato, a un costo circa 7 volte inferiore.
|
|
38
38
|
- **Le citazioni sono dove gli LLM mentono.** Walters & Wilder 2023 ([doi:10.1038/s41598-023-41032-5](https://doi.org/10.1038/s41598-023-41032-5)) — il 55% delle citazioni di GPT-3.5 / il 18% di GPT-4 sono fabbricate. Onweller et al. 2026 ([arXiv:2605.06635](https://arxiv.org/abs/2605.06635)) — i collegamenti risolvono oltre il 94% delle volte, ma solo il 39-77% del contenuto citato supporta effettivamente l'affermazione. Pertanto, l'esistenza deve essere verificata tramite **recupero, non richiamo**.
|
|
39
39
|
- **Nascondere il ragionamento del generatore.** Khalifa et al. 2026 ([arXiv:2601.14691](https://arxiv.org/abs/2601.14691), "Gaming the Judge") — la sola manipolazione della catena di pensiero aumenta i falsi positivi del giudice fino al 90%, mantenendo le azioni fisse. Turpin et al. 2023 ([arXiv:2305.04388](https://arxiv.org/abs/2305.04388)) — la catena di pensiero è una razionalizzazione post-hoc. Il verificatore vede solo l'affermazione della citazione, mai il "perché ho incluso questo".
|
|
40
40
|
- **La diversità supera la quantità.** Rajan 2025 ([arXiv:2511.16708](https://arxiv.org/abs/2511.16708)) — quattro verificatori con una correlazione a coppie ρ ∈ [0,05, 0,25] superano qualsiasi singolo verificatore tramite copertura submodulare. Kim et al. 2025 ([arXiv:2506.07962](https://arxiv.org/abs/2506.07962)) — gli errori degli LLM sono *correlati*, quindi la variabile più importante è la diversità delle "lenti", non la quantità assoluta.
|
|
@@ -75,12 +75,15 @@ npm i -g @dogfood-lab/study-swarm # or run ad-hoc: npx @dogfood-lab/study-sw
|
|
|
75
75
|
|---|---|
|
|
76
76
|
| `study-swarm protocol` | Stampa l'intero protocollo: i cinque passaggi, la tabella di arresto e lo standard di riferimento. |
|
|
77
77
|
| `study-swarm new <slug>` | Crea uno scheletro `<slug>.dispatch.md` con i cinque passaggi da completare. |
|
|
78
|
-
| `study-swarm lint [--json] <path…>` | Verifica
|
|
79
|
-
| `study-swarm
|
|
78
|
+
| `study-swarm lint [--json] [--strict] <path…>` | Verifica l'attendibilità delle *fonti* di un documento rispetto agli standard di riferimento: ogni affermazione deve avere un autore, un anno e un identificatore univoco (arXiv / DOI / URL / RFC); le affermazioni generiche del tipo "gli studi dimostrano..." non sono accettate. In caso di violazioni, il processo termina con codice `1`, interrompendo così l'esecuzione continua (CI). Un `<path>` può essere un file, una directory (analizzata ricorsivamente per i file `*.dispatch.md`) o `-` per l'input standard; `--json` genera un report leggibile da macchina. L'opzione `--strict` contrassegna inoltre le **citazioni orfane** (un'affermazione che non è citata in nessuno dei passaggi), poiché "le citazioni senza una connessione sono irrilevanti" (questa opzione è facoltativa, quindi l'impostazione predefinita per il processo CI rimane invariata). |
|
|
79
|
+
| `study-swarm return <dispatch> [--check]` | Scrive i risultati: `<stem>.results.md` è il foglio da consegnare, e `<stem>.results.json` conserva gli stessi fatti accanto al dispatch per l'esecuzione successiva. `--check` fallisce se una delle due copie non corrisponde più al dispatch. |
|
|
80
|
+
| `study-swarm lock --init <dispatch>` | Crea il file `<dispatch>.orchestration.json`: un modello di configurazione da completare con i dati necessari (un passaggio per ogni agente del Passo 2) e che verrà utilizzato con il comando `lock … --from`. |
|
|
81
|
+
| `study-swarm lock <dispatch> --from <orchestration.json>` | Blocca un sistema per la riproduzione: scrive il contenuto di `<dispatch>.lock.json`, che, per ogni agente del passaggio 2, include l'**ID del modello risolto**, l'**SHA-256 del prompt normalizzato (BOM rimosso, a capo in LF, NFC)** e l'**SHA-256 dello schema dello strumento**, oltre alla **ricevuta del verificatore** del passaggio 4, tutto racchiuso in un unico `lock_sha256`. |
|
|
80
82
|
| `study-swarm lock --verify <dispatch> [--from …]` | Ricalcola questi hash e verifica che corrispondano al blocco; qualsiasi discrepanza fa terminare il programma con codice `1`, in modo da bloccare l'integrazione continua (CI) come farebbe un file di blocco dei pacchetti. Senza `--from`, controlla l'integrità del blocco stesso. |
|
|
81
|
-
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` | **Meccanismo di compensazione per il rollback
|
|
82
|
-
| `study-swarm requalify --check <corpus-dir>` | In caso di
|
|
83
|
-
| `study-swarm requalify --
|
|
83
|
+
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` | **Meccanismo di compensazione per il rollback.** Contrassegna ogni documento nel corpus in cui la sezione *Research grounding* (attendibilità delle fonti) cita `<id>` come `evidence-withdrawn` (un file "tombstone" aggiuntivo `<slug>.withdrawn.json": contrassegna, ma non elimina) e genera una ricevuta di rimozione basata sul contenuto. `--reason` ∈ `fabricated · misattributed · retracted · verifier-flipped · other`. |
|
|
84
|
+
| `study-swarm requalify --check <corpus-dir>` | In caso di errori, il processo termina con codice `1` per qualsiasi documento che contenga un flag `evidence-withdrawn` non risolto: questo è l'indicatore (andon) che **interrompe** i processi dipendenti da un'affermazione rimossa fino a quando questa non viene eliminata o rielaborata. Interrompe il processo CI. |
|
|
85
|
+
| `study-swarm requalify --status <corpus-dir> [--json]` | Visualizza in sola lettura lo stato di attendibilità delle fonti del corpus: numero di documenti rimossi rispetto a quelli risolti, suddivisione per motivo e modalità di risoluzione, informazioni per ogni documento. Informazioni generali (il processo termina con codice `0`), a differenza dell'opzione `--check`. |
|
|
86
|
+
| `study-swarm requalify --resolve <dispatch> <id> --mode removed\|regrounded [--note …]` | Rimuove il flag una volta che l'affermazione è stata eliminata (la citazione non esiste più) o rielaborata (verificata nuovamente dal processo parallelo; `--note` registra la conferma). L'operazione può essere eseguita più volte; aggiunge informazioni al registro di controllo del file aggiuntivo. |
|
|
84
87
|
|
|
85
88
|
`lint` è deterministico: non effettua chiamate al modello, quindi è sicuro da utilizzare nell'integrazione continua (CI). Applica **lo standard di riferimento del passaggio 3** a livello locale; la verifica basata sul modello del **passaggio 4** si basa ancora su [`roleos verify-citations`](https://github.com/mcp-tool-shop-org/role-os) → prism.
|
|
86
89
|
|
|
@@ -93,7 +96,7 @@ study-swarm lint my-decision.dispatch.md # enforce the sourcing standard
|
|
|
93
96
|
roleos verify-citations my-decision.dispatch.md # model-based Step 4 (different family, via prism)
|
|
94
97
|
```
|
|
95
98
|
|
|
96
|
-
Quattro
|
|
99
|
+
Quattro documenti completi e validati vengono utilizzati come riferimento: [`examples/study-swarm-self.dispatch.md`](examples/study-swarm-self.dispatch.md) (la decisione centrale del protocollo, in forma compatta), [`examples/study-swarm-v1_1.dispatch.md`](examples/study-swarm-v1_1.dispatch.md) (l'implementazione completa della versione 1.1: 27 citazioni, tutte verificate esternamente), [`examples/study-swarm-lock.dispatch.md`](examples/study-swarm-lock.dispatch.md) (il design della versione 1.2 con il meccanismo di blocco: 39 citazioni, gestite tramite il processo parallelo, ed è il primo documento a includere il proprio meccanismo di blocco) e [`examples/study-swarm-canon-rollback.dispatch.md`](examples/study-swarm-canon-rollback.dispatch.md) (il design della versione 1.3 con il meccanismo di rollback: 27 citazioni relative alla revoca, al ritiro, alle sequenze di eventi e all'invalidazione della build, ed è il primo documento ad essere rimosso e poi riqualificato).
|
|
97
100
|
|
|
98
101
|
### Bloccalo nell'integrazione continua (CI)
|
|
99
102
|
|
|
@@ -104,7 +107,7 @@ Quattro elementi completi, puliti e funzionanti vengono pubblicati come riferime
|
|
|
104
107
|
name: study-swarm lint
|
|
105
108
|
on:
|
|
106
109
|
pull_request:
|
|
107
|
-
paths: ['**/*.dispatch.md', '.github/workflows/dispatches.yml']
|
|
110
|
+
paths: ['**/*.dispatch.md', '**/*.withdrawn.json', '.github/workflows/dispatches.yml']
|
|
108
111
|
workflow_dispatch:
|
|
109
112
|
concurrency:
|
|
110
113
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
@@ -112,22 +115,26 @@ concurrency:
|
|
|
112
115
|
jobs:
|
|
113
116
|
lint:
|
|
114
117
|
runs-on: ubuntu-latest
|
|
118
|
+
timeout-minutes: 5
|
|
115
119
|
steps:
|
|
116
120
|
- uses: actions/checkout@v4
|
|
117
121
|
- uses: actions/setup-node@v4
|
|
118
122
|
with: { node-version: '20' }
|
|
119
|
-
- run: npx @dogfood-lab/study-swarm@
|
|
123
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 lint dispatches/
|
|
124
|
+
# Halt the build while any finding that became canon is withdrawn and not yet
|
|
125
|
+
# removed or re-grounded — the canon-rollback andon (exit 1 on any unresolved flag).
|
|
126
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 requalify --check dispatches/
|
|
120
127
|
```
|
|
121
128
|
|
|
122
129
|
### Blocca un sistema per la riproduzione (`dispatch.lock.json`)
|
|
123
130
|
|
|
124
|
-
Un sistema fondato e verificato è auditabile solo se si può dire *cosa lo ha prodotto*. `study-swarm lock` scrive un file di blocco complementare che, per ogni agente di ricerca, include l'**ID del modello risolto** (mai un alias fluttuante), l'**SHA-256 del prompt
|
|
131
|
+
Un sistema fondato e verificato è auditabile solo se si può dire *cosa lo ha prodotto*. `study-swarm lock` scrive un file di blocco complementare che, per ogni agente di ricerca, include l'**ID del modello risolto** (mai un alias fluttuante), l'**SHA-256 del prompt normalizzato (BOM rimosso, a capo in LF, NFC)** e l'**SHA-256 dello schema dello strumento** fornito, oltre alla **ricevuta del verificatore esterno**, tutto racchiuso in un unico `lock_sha256`. `study-swarm lock --verify` ricalcola questi hash e fallisce se rileva discrepanze, quindi una modifica al prompt, uno scambio di modello o una variazione della superficie dello strumento vengono rilevati: lo standard di riproducibilità [PIN_PER_STEP](https://github.com/dogfood-lab/study-swarm), reso eseguibile. Il sistema emette il record; l'interfaccia a riga di comando rimane senza dipendenze e indipendente dalla rete, limitandosi alla normalizzazione (RFC 8785), all'hashing e alla convalida.
|
|
125
132
|
|
|
126
133
|
**Blocca gli input, non gli output.** Bloccare il modello + prompt + temperatura *non* rende l'output di un LLM identico bit per bit: l'invarianza del batch, la non associatività dei numeri in virgola mobile, il routing a esperti multipli e la deriva silenziosa del provider sono tutti elementi al di fuori del controllo di uno strumento offline. Pertanto, il blocco fornisce **input riproducibili e output con rilevamento della deriva**, mai una "riproduzione deterministica". Il progetto è basato su evidenze, citazione per citazione, in [`examples/study-swarm-lock.dispatch.md`](examples/study-swarm-lock.dispatch.md) — la prima implementazione che include il proprio blocco ([`examples/study-swarm-lock.lock.json`](examples/study-swarm-lock.lock.json)).
|
|
127
134
|
|
|
128
|
-
### Esegue il rollback di
|
|
135
|
+
### Esegue il rollback di un'affermazione rimossa (`withdraw` / `requalify`)
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
Un'affermazione verificata diventa **canonica**: fornisce informazioni per una decisione successiva. Quindi, cosa succede quando viene successivamente **rimossa** (una citazione si rivela falsa/errata durante una nuova esecuzione, un articolo citato viene ritirato o il meccanismo di controllo la contrassegna)? Un comando `git revert` non è sufficiente, perché l'affermazione è già stata propagata. Il meccanismo di compensazione per il rollback rende possibile questa operazione:
|
|
131
138
|
|
|
132
139
|
```bash
|
|
133
140
|
study-swarm withdraw arXiv:2402.15089 --reason misattributed --from dispatches/ --receipt rollback.json
|
|
@@ -137,7 +144,7 @@ study-swarm requalify --check dispatches/ # exit 1 while any flag is un
|
|
|
137
144
|
study-swarm requalify --resolve d.dispatch.md arXiv:2402.15089 --mode removed # or: --mode regrounded --note "<attestation>"
|
|
138
145
|
```
|
|
139
146
|
|
|
140
|
-
`requalify --check` **
|
|
147
|
+
`requalify --check` **termina con errore** finché ogni affermazione contrassegnata non viene rimossa o **rielaborata** (verificata nuovamente dal processo parallelo; la CLI registra la conferma, ma non esegue essa stessa la verifica). La rimozione viene evidenziata in modo **contraddittorio**, e non semplicemente eliminando l'elemento. Tutto (il file "tombstone" e la ricevuta) è basato sul contenuto ed è rilevabile nel tempo, e opera solo sullo strato delle *fonti*: `lock --verify` non viene influenzato dalla rimozione. Il design si basa su [`examples/study-swarm-canon-rollback.dispatch.md`](examples/study-swarm-canon-rollback.dispatch.md), e il documento [PROTOCOL.md](PROTOCOL.md) §"Compensating a withdrawn finding" rappresenta l'implementazione pratica. Questo è lo standard **NAMED_COMPENSATORS** reso eseguibile: un meccanismo di annullamento denominato e idempotente che lascia uno stato finale noto e una ricevuta.
|
|
141
148
|
|
|
142
149
|
## Perché funziona, in sintesi:
|
|
143
150
|
|
|
@@ -145,11 +152,11 @@ study-swarm requalify --resolve d.dispatch.md arXiv:2402.15089 --mode removed
|
|
|
145
152
|
|
|
146
153
|
## Sicurezza
|
|
147
154
|
|
|
148
|
-
`study-swarm` include una **CLI leggera, senza dipendenze** (`study-swarm`) insieme alla metodologia. Non effettua **nessuna chiamata di rete o al modello** e non raccoglie **dati di telemetria**; non ci sono segreti o credenziali nel codice sorgente. In fase di esecuzione legge
|
|
155
|
+
`study-swarm` include una **CLI leggera, senza dipendenze** (`study-swarm`) insieme alla metodologia. Non effettua **nessuna chiamata di rete o al modello** e non raccoglie **dati di telemetria**; non ci sono segreti o credenziali nel codice sorgente. In fase di esecuzione legge i file che nomini. `new` scrive un solo `<slug>.dispatch.md` nella directory di lavoro (senza sovrascrivere e senza uscirne). `lock`, `withdraw` e `requalify` scrivono anche un lock, un sidecar tombstone e, con `--receipt`, una ricevuta nel percorso indicato. La verifica basata sul modello descritta dalla metodologia (Passaggio 4) viene eseguita dagli strumenti correlati, non da questo pacchetto. Vedere [SECURITY.md](SECURITY.md).
|
|
149
156
|
|
|
150
157
|
## Stato
|
|
151
158
|
|
|
152
|
-
Un protocollo funzionante, verificato esternamente dai
|
|
159
|
+
Un protocollo funzionante, verificato esternamente dai suoi stessi strumenti: una famiglia diversa di modelli verifica le sue citazioni (vedi la prova sopra). La **versione 1.1** migliora il meccanismo di verifica rispetto alla prima versione, che era silenziosa: attendibilità delle fonti decomposta/ternaria, verifica al momento della generazione, una cascata controllata da un oracolo per combinare le diverse prospettive e astensione calibrata: ogni elemento è basato sull'affermazione verificata nella versione 1.1. La **versione 1.2** rende un documento riproducibile: `study-swarm lock` memorizza il modello, il prompt e lo schema degli strumenti risolti per ogni passaggio, oltre alla ricevuta del meccanismo di verifica, e `lock --verify` termina con errore in caso di modifiche non autorizzate. La **versione 1.3** rende eseguibile il rollback: quando un'affermazione che è già diventata canonica viene rimossa, `study-swarm withdraw` contrassegna tutti gli elementi dipendenti e `requalify --check` li interrompe, terminando con errore finché non vengono rimossi o rielaborati: un meccanismo di compensazione denominato, dotato di ricevuta e idempotente. La **versione 2.0** rende più parti del protocollo eseguibili e rafforza il meccanismo di blocco: `lint --strict` contrassegna le citazioni orfane (l'unico tipo di errore che la CLI non riusciva a rilevare), `lock --init` crea il modello di configurazione, `requalify --status` legge lo stato delle fonti del corpus e l'indirizzamento basato sul contenuto del blocco è separato per dominio (schema degli artefatti versione 2: un blocco da una versione precedente viene rigenerato anziché essere contrassegnato erroneamente come manomesso; la superficie dei comandi della CLI rimane compatibile con le versioni precedenti). Questo repository è il riferimento pubblico; [PROTOCOL.md](PROTOCOL.md) rappresenta l'implementazione pratica. Fa parte della famiglia [dogfood-lab](https://github.com/dogfood-lab): metodi e esempi per lo sviluppo nell'era dell'intelligenza artificiale.
|
|
153
160
|
|
|
154
161
|
Con licenza MIT.
|
|
155
162
|
|
package/README.ja.md
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
1. **特定する:** 実証的な証拠によって回答が変わる可能性のある、3〜5個の重要な設計上の質問を特定する。
|
|
25
25
|
2. **派遣する:** 各質問に対して、並行して1つの研究エージェントを派遣する。各エージェントは、論文タイトル+著者+年+URL+一文の調査結果を返す必要がある(広範囲よりも具体性重視。「6〜8件の信頼できる調査結果が、20件の曖昧な情報よりも優れている」)。
|
|
26
|
-
3. **統合する:**
|
|
27
|
-
4. **外部で検証する:** *別のモデルファミリー*(推論機能を削除したもの)を使用して、すべての引用を2
|
|
26
|
+
3. **統合する:** 調査結果を「Research grounding」(研究による根拠)セクションに統合する:「N.**<調査結果>。<著者><年>(<arXiv/DOI>)。<設計への影響>。」
|
|
27
|
+
4. **外部で検証する:** *別のモデルファミリー*(推論機能を削除したもの)を使用して、すべての引用を2つの段階でチェックする。まず、**検索オラクル**が論文が存在することを確認する(モデルの記憶ではなく)。次に、「根拠」レンズが、調査結果が情報源と一致することを確認する。捏造された知見は**捨てる**。誤帰属は**一度だけ直し**、再検証する(二度目の不合格で捨てる)。検証者または検索オラクルが使えないときだけ**停止してエスカレーションする**(不在を「引用は問題ない」と解釈しない)。
|
|
28
28
|
5. **関連付ける:** 各アーキテクチャの選択を、番号を使って調査結果に関連付ける。設計への影響がない引用はノイズである。
|
|
29
29
|
|
|
30
30
|
完全な実行可能な詳細(停止テーブル、情報源に関する標準、アンサンブルルール)は、**[PROTOCOL.md](PROTOCOL.md)**に記載されている。
|
|
@@ -75,12 +75,15 @@ npm i -g @dogfood-lab/study-swarm # or run ad-hoc: npx @dogfood-lab/study-sw
|
|
|
75
75
|
|---|---|
|
|
76
76
|
| `study-swarm protocol` | 完全なプロトコル(5つのステップ、停止テーブル、ソース標準)を出力します。 |
|
|
77
77
|
| `study-swarm new <slug>` | 5つのステップのスケルトンを含む`<slug>.dispatch.md`を作成し、それを埋めるためのテンプレートを提供します。 |
|
|
78
|
-
| `study-swarm lint [--json] <path…>` |
|
|
79
|
-
| `study-swarm
|
|
78
|
+
| `study-swarm lint [--json] [--strict] <path…>` | ディスパッチの「Research grounding」(研究根拠)を、ソースの標準と比較して確認します。すべての調査結果には、著者、年、および解決可能な識別子(arXiv / DOI / URL / RFC)が必要です。「研究では~と示されています…」という曖昧な表現は認められません。違反があった場合は `1` を返して処理を停止し、CI のゲートとして機能します。`<path>` は、ファイル、ディレクトリ(`*.dispatch.md` に対して再帰的にチェックされます)、または標準入力 (`-`) にすることができます。`--json` オプションを使用すると、機械可読のレポートが出力されます。`--strict` オプションを追加すると、**孤立した引用**(Step 5 のいずれかの選択肢で参照されていない調査結果)がフラグ付けされます。「関連性のない引用はノイズである」ためです(オプションであり、デフォルトの CI ゲートは変更されません)。 |
|
|
79
|
+
| `study-swarm return <dispatch> [--check]` | 結果を書き出します。`<stem>.results.md` は渡すシート、`<stem>.results.json` は同じ内容を dispatch の横に残す記録です。`--check` はどちらかが dispatch からずれると失敗します。 |
|
|
80
|
+
| `study-swarm lock --init <dispatch>` | `<dispatch>.orchestration.json` を作成します。これは、`lock … --from` に渡すための、穴埋め形式のハーネスレコードです(Step-2 のエージェントごとに1つのステップ)。 |
|
|
81
|
+
| `study-swarm lock <dispatch> --from <orchestration.json>` | ディスパッチをリプレイ用に固定します。`<dispatch>.lock.json`ファイルに、ステップ2のエージェントごとに、**解決されたモデルID** + **テキスト正規化したプロンプトのSHA-256(BOM除去、改行をLF、NFC)** + **ツールスキーマのSHA-256ハッシュ**、およびステップ4の**検証レシート**をまとめて書き込みます。これらを1つの`lock_sha256`にまとめます。 |
|
|
80
82
|
| `study-swarm lock --verify <dispatch> [--from …]` | これらのハッシュを再計算し、ロックファイルと一致することを確認します。いずれかのハッシュが異なる場合、終了コード`1`を返し、CIでゲートとして機能します(パッケージのロックファイルと同様)。`--from`オプションがない場合は、ロックファイルの整合性をチェックします。 |
|
|
81
|
-
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` |
|
|
82
|
-
| `study-swarm requalify --check <corpus-dir>` |
|
|
83
|
-
| `study-swarm requalify --
|
|
83
|
+
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` | **カノンロールバック補正器**。コーパス内のすべてのディスパッチについて、「Research grounding」(研究根拠)で `<id>` を引用しているものを `evidence-withdrawn` としてフラグ付けします(墓石のようなサイドカーファイル `<slug>.withdrawn.json` で、フラグを立てますが削除はしません)。また、コンテンツアドレス指定された取り下げレシートを出力します。`--reason` は `fabricated · misattributed · retracted · verifier-flipped · other` のいずれかです。 |
|
|
84
|
+
| `study-swarm requalify --check <corpus-dir>` | 未解決の `evidence-withdrawn` フラグを持つディスパッチがある場合、処理を停止してエラー (`1`) を返します。これは、取り下げられた調査結果に依存するものを、削除または再検証されるまで停止させるための「アンドン」です。CI のゲートとしても機能します。 |
|
|
85
|
+
| `study-swarm requalify --status <corpus-dir> [--json]` | コーパスの読み取り専用の証拠健全性**ビュー**を提供します。取り下げられたものと解決されたものの数、理由および解決モードごとの内訳、ディスパッチごとの行を表示します。これは情報提供のみを目的としており(`0` を返します)、`--check` ゲートとは異なります。 |
|
|
86
|
+
| `study-swarm requalify --resolve <dispatch> <id> --mode removed\|regrounded [--note …]` | 調査結果が削除されたとき(引用がなくなったとき)または再検証されたときに、フラグをクリアします(兄弟ランナーによって再度検証され、問題がないことが確認されます。`--note` には証拠が記録されます)。べき等であり、サイドカーの監査ログに追加されます。 |
|
|
84
87
|
|
|
85
88
|
`lint`は決定論的であり、モデル呼び出しはゼロであるため、CIでの使用に安全です。ローカルで**ステップ3のソース標準**を適用し、モデルベースの**ステップ4**検証は引き続き[`roleos verify-citations`](https://github.com/mcp-tool-shop-org/role-os) → prismに委ねます。
|
|
86
89
|
|
|
@@ -93,7 +96,7 @@ study-swarm lint my-decision.dispatch.md # enforce the sourcing standard
|
|
|
93
96
|
roleos verify-citations my-decision.dispatch.md # model-based Step 4 (different family, via prism)
|
|
94
97
|
```
|
|
95
98
|
|
|
96
|
-
4つの完全で、lint
|
|
99
|
+
4つの完全で、lint チェックに合格したディスパッチを参考として提供します:[`examples/study-swarm-self.dispatch.md`](examples/study-swarm-self.dispatch.md)(プロトコルの中心的な決定であり、コンパクト)、[`examples/study-swarm-v1_1.dispatch.md`](examples/study-swarm-v1_1.dispatch.md)(完全な v1.1 の設計パスであり、27件の引用があり、そのすべてが外部で検証されています)、[`examples/study-swarm-lock.dispatch.md`](examples/study-swarm-lock.dispatch.md)(v1.2 のロック設計であり、39件の引用があり、ランナーを通じてゲートされ、独自のロックを最初に提供するディスパッチです)、および [`examples/study-swarm-canon-rollback.取り消し、撤回、サガ、ビルド無効化など、27件の引用が含まれており、最初に取り下げられてから再検証されるディスパッチです)。
|
|
97
100
|
|
|
98
101
|
### CIでゲートとして使用する
|
|
99
102
|
|
|
@@ -104,7 +107,7 @@ roleos verify-citations my-decision.dispatch.md # model-based Step 4 (different
|
|
|
104
107
|
name: study-swarm lint
|
|
105
108
|
on:
|
|
106
109
|
pull_request:
|
|
107
|
-
paths: ['**/*.dispatch.md', '.github/workflows/dispatches.yml']
|
|
110
|
+
paths: ['**/*.dispatch.md', '**/*.withdrawn.json', '.github/workflows/dispatches.yml']
|
|
108
111
|
workflow_dispatch:
|
|
109
112
|
concurrency:
|
|
110
113
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
@@ -112,22 +115,26 @@ concurrency:
|
|
|
112
115
|
jobs:
|
|
113
116
|
lint:
|
|
114
117
|
runs-on: ubuntu-latest
|
|
118
|
+
timeout-minutes: 5
|
|
115
119
|
steps:
|
|
116
120
|
- uses: actions/checkout@v4
|
|
117
121
|
- uses: actions/setup-node@v4
|
|
118
122
|
with: { node-version: '20' }
|
|
119
|
-
- run: npx @dogfood-lab/study-swarm@
|
|
123
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 lint dispatches/
|
|
124
|
+
# Halt the build while any finding that became canon is withdrawn and not yet
|
|
125
|
+
# removed or re-grounded — the canon-rollback andon (exit 1 on any unresolved flag).
|
|
126
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 requalify --check dispatches/
|
|
120
127
|
```
|
|
121
128
|
|
|
122
129
|
### ディスパッチをリプレイ用に固定する(`dispatch.lock.json`)
|
|
123
130
|
|
|
124
|
-
根拠があり、検証されたディスパッチは、それがどのように生成されたかを説明できれば、監査可能になります。`study-swarm lock`は、コンパニオンのロックファイルを書き込みます。このファイルには、研究エージェントごとに、**解決されたモデルID
|
|
131
|
+
根拠があり、検証されたディスパッチは、それがどのように生成されたかを説明できれば、監査可能になります。`study-swarm lock`は、コンパニオンのロックファイルを書き込みます。このファイルには、研究エージェントごとに、**解決されたモデルID**(浮動するエイリアスではありません)、**テキスト正規化したプロンプトのSHA-256(BOM除去、改行をLF、NFC)**、および与えられた**ツールスキーマのSHA-256ハッシュ**、さらに外部の**検証レシート**が記録されます。これらはすべて1つの`lock_sha256`にまとめられます。`study-swarm lock --verify`は、これらのハッシュを再計算し、いずれかのハッシュが異なる場合、エラーを表示します。したがって、プロンプトが変更されたり、モデルが切り替えられたり、ツールのバージョンが変更されたりすると、検知されます。[PIN_PER_STEP](https://github.com/dogfood-lab/study-swarm)再現性標準を実際に実行できます。この処理は、レコードを出力し、CLIはゼロ依存でネットワークにアクセスする必要がなく、単に正規化(RFC 8785)、ハッシュ化、および検証を行います。
|
|
125
132
|
|
|
126
133
|
**入力は固定し、出力は固定しません。** モデル、プロンプト、温度を固定しても、LLMの出力が完全に同一になるわけではありません。バッチ不変性、浮動小数点演算の非結合性、混合エキスパートルーティング、およびサイレントプロバイダドリフトなど、オフラインツールで制御できない要素が存在するためです。したがって、この仕組みは、**再現可能な入力とドリフトを検出可能な出力を提供し、「決定的な再現」を実現するものではありません。** この設計は、[`examples/study-swarm-lock.dispatch.md`](examples/study-swarm-lock.dispatch.md) に記載されているように、個々の要素に基づいて構築されており、独自のロック機能を備えた最初のバージョン ([`examples/study-swarm-lock.lock.json`](examples/study-swarm-lock.lock.json)) として提供されます。
|
|
127
134
|
|
|
128
|
-
###
|
|
135
|
+
### 取り下げられた調査結果をロールバックします(`withdraw` / `requalify`)
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
検証された調査結果は**カノン**になります。これは、後続の決定に影響を与えます。では、後で**取り下げられた**場合(再実行時に引用が捏造または誤って帰属されていることが判明した場合、引用された論文が撤回された場合、またはゲートがそれを反転させた場合)はどうなるでしょうか? `git revert` だけでは不十分です。なぜなら、調査結果はすでに伝播しているからです。カノンロールバック補正器を使用すると、クリーンアップを確実に実行できます。
|
|
131
138
|
|
|
132
139
|
```bash
|
|
133
140
|
study-swarm withdraw arXiv:2402.15089 --reason misattributed --from dispatches/ --receipt rollback.json
|
|
@@ -137,7 +144,7 @@ study-swarm requalify --check dispatches/ # exit 1 while any flag is un
|
|
|
137
144
|
study-swarm requalify --resolve d.dispatch.md arXiv:2402.15089 --mode removed # or: --mode regrounded --note "<attestation>"
|
|
138
145
|
```
|
|
139
146
|
|
|
140
|
-
`requalify --check
|
|
147
|
+
`requalify --check` は、フラグが立てられたすべての調査結果が削除されるか、**再検証されるまで**(兄弟ランナーによって再度検証され、問題がないことが確認されます。CLI は証拠を記録しますが、それ自体で再検証は行いません)、**処理を停止してエラーを返します**。取り下げは、静かにドロップするのではなく、**対照的に**表示されます。すべて(墓石とレシート)がコンテンツアドレス指定され、ドリフト検出が可能であり、*証拠* レイヤーでのみ動作します:`lock --verify` は取り消しによって影響を受けません。この設計は [`examples/study-swarm-canon-rollback.dispatch.md`](examples/study-swarm-canon-rollback.dispatch.md) に基づいており、[PROTOCOL.md](PROTOCOL.md) の「Compensating a withdrawn finding」セクションが実行可能な形式です。これは、**NAMED_COMPENSATORS** 標準を実行可能にしたものです。名前付きでべき等なアンドゥ操作であり、既知のポスト状態とレシートを残します。
|
|
141
148
|
|
|
142
149
|
## その仕組みを簡潔に説明します
|
|
143
150
|
|
|
@@ -145,11 +152,11 @@ study-swarm requalify --resolve d.dispatch.md arXiv:2402.15089 --mode removed
|
|
|
145
152
|
|
|
146
153
|
## セキュリティ
|
|
147
154
|
|
|
148
|
-
`study-swarm` は、この手法とともに、**軽量で依存関係のないCLI(コマンドラインインターフェース)** (`study-swarm`) を提供します。**ネットワーク接続やモデルへのアクセスは行わず、テレメトリデータも収集しません。**
|
|
155
|
+
`study-swarm` は、この手法とともに、**軽量で依存関係のないCLI(コマンドラインインターフェース)** (`study-swarm`) を提供します。**ネットワーク接続やモデルへのアクセスは行わず、テレメトリデータも収集しません。** ソースコードには、秘密情報や認証情報は含まれていません。実行時には、指定したファイルを読み取ります。`new` は作業ディレクトリに `<slug>.dispatch.md` を1つだけ書き込みます(上書きせず、ディレクトリの外にも書きません)。`lock`、`withdraw`、`requalify` は lock ファイルと墓標 sidecar も書き、`--receipt` を渡すとそのパスにレシートを書きます。この手法で説明されているモデルベースの検証(ステップ4)は、このパッケージではなく、関連するツールによって実行されます。詳細は [SECURITY.md](SECURITY.md) を参照してください。
|
|
149
156
|
|
|
150
157
|
## ステータス
|
|
151
158
|
|
|
152
|
-
|
|
159
|
+
独自のメカニズムによって外部検証された動作するプロトコルです。別のモデルファミリーがその引用をチェックします(上記の証拠を参照)。**v1.1** では、最初のリリースでは静的だった検証器が強化されています:分解/三値の根拠付け、生成時の根拠付け、レンズを組み合わせるためのオラクルゲート付きカスケード、および調整された棄権。これらはすべて、検証済みの v1.1 ディスパッチに基づいています。**v1.2** では、ディスパッチがバイト単位で再現可能になります:`study-swarm lock` は、ステップごとの解決済みモデル、プロンプト、ツールスキーマと、検証器レシートを固定します。また、`lock --verify` はドリフトが発生すると処理を停止してエラーを返します。**v1.3** では、ロールバックを実行可能にします:すでにカノンになった調査結果が取り下げられた場合、`study-swarm withdraw` はすべての依存関係にフラグを立て、`requalify --check` はそれらを削除または再検証されるまで処理を停止してエラーを返します。これは、名前付きでレシート付きのべき等な補正器です。**v2.0** では、プロトコルのより多くの部分を実行可能にし、ロックを強化します:`lint --strict` は孤立した引用にフラグを立てます(CLI が検出できなかった唯一の失敗モード)、`lock --init` はハーネスレコードを作成し、`requalify --status` はコーパスの証拠健全性を読み取り、ロックのコンテンツアドレス指定はドメインで分離されます(アーティファクトスキーマ v2。以前のバージョンのロックは再生成され、改ざんされたと誤ってフラグが立てられることはありません。CLI のコマンドサーフェスは後方互換性を維持します)。このリポジトリは公開参照であり、[PROTOCOL.md](PROTOCOL.md) が実行可能な形式です。これは、[dogfood-lab](https://github.com/dogfood-lab) ファミリーの一部であり、AI 時代に構築するための方法とデモンストレーションを提供します。
|
|
153
160
|
|
|
154
161
|
MITライセンス。
|
|
155
162
|
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ It applies its own medicine. The protocol prescribes verifier-protected envelope
|
|
|
24
24
|
1. **Identify** 3–5 load-bearing design questions where empirical evidence would change the answer.
|
|
25
25
|
2. **Dispatch** one research agent per question, in parallel. Each must return paper titles + authors + years + URLs + a one-sentence finding — specificity over breadth ("6–8 well-sourced findings beat 20 vague gestures").
|
|
26
26
|
3. **Synthesize** the findings into a *Research grounding* section: `N. **<finding>.** <Authors> <year> (<arXiv/DOI>). <design implication>.`
|
|
27
|
-
4. **Verify externally** — a *different model family*, reasoning-stripped, checks every citation in two stages: a **retrieval oracle** confirms the paper exists (never the model's memory), then a **groundedness** lens confirms the finding matches the source. **
|
|
27
|
+
4. **Verify externally** — a *different model family*, reasoning-stripped, checks every citation in two stages: a **retrieval oracle** confirms the paper exists (never the model's memory), then a **groundedness** lens confirms the finding matches the source. **Drop** a fabricated finding; **correct a misattribution once** and re-verify (a second non-clean verdict drops it). **Halt-and-escalate** only when the verifier or the retrieval oracle is unavailable (never read absence as "citations fine").
|
|
28
28
|
5. **Connect** each architectural choice back to a finding by number. Citations without a design implication are noise.
|
|
29
29
|
|
|
30
30
|
The full executable detail — the halt table, the sourcing standard, the ensemble rule — is in **[PROTOCOL.md](PROTOCOL.md)**.
|
|
@@ -75,11 +75,14 @@ npm i -g @dogfood-lab/study-swarm # or run ad-hoc: npx @dogfood-lab/study-sw
|
|
|
75
75
|
|---|---|
|
|
76
76
|
| `study-swarm protocol` | Print the full protocol — the five steps, the halt table, the sourcing standard. |
|
|
77
77
|
| `study-swarm new <slug>` | Scaffold a `<slug>.dispatch.md` with the five-step skeleton to fill in. |
|
|
78
|
-
| `study-swarm lint [--json] <path…>` | Check a dispatch's *Research grounding* against the sourcing standard — every finding needs an author, a year, and a resolvable identifier (arXiv / DOI / URL); "studies show…" hand-waving is rejected. Exit `1` on violations, so it gates CI. A `<path>` may be a file, a directory (linted recursively for `*.dispatch.md`), or `-` for stdin; `--json` emits a machine-readable report. |
|
|
79
|
-
| `study-swarm
|
|
78
|
+
| `study-swarm lint [--json] [--strict] <path…>` | Check a dispatch's *Research grounding* against the sourcing standard — every finding needs an author, a year, and a resolvable identifier (arXiv / DOI / URL / RFC); "studies show…" hand-waving is rejected. Exit `1` on violations, so it gates CI. A `<path>` may be a file, a directory (linted recursively for `*.dispatch.md`), or `-` for stdin; `--json` emits a machine-readable report. `--strict` additionally flags **orphan citations** — a finding no Step-5 choice references — since "citations without a connection are noise" (opt-in, so the default CI gate is unchanged). |
|
|
79
|
+
| `study-swarm return <dispatch> [--check]` | Write the results of a dispatch: `<stem>.results.md` is the sheet you hand someone, and `<stem>.results.json` is the same facts kept beside it for the next run to open. `--check` fails if either copy has drifted from the dispatch. |
|
|
80
|
+
| `study-swarm lock --init <dispatch>` | Scaffold `<dispatch>.orchestration.json` — a fill-in-the-blanks harness record (one step per Step-2 agent) to feed to `lock … --from`. |
|
|
81
|
+
| `study-swarm lock <dispatch> --from <orchestration.json>` | Pin a dispatch for replay — write `<dispatch>.lock.json` content-addressing, per Step-2 agent, the **resolved model id** + the **SHA-256 of the text-normalized prompt** (BOM stripped, newlines folded to LF, NFC) + the **SHA-256 of the tool schema**, plus the Step-4 **verifier receipt**, rolled into one `lock_sha256`. |
|
|
80
82
|
| `study-swarm lock --verify <dispatch> [--from …]` | Re-derive those hashes and assert they match the lock; any drift exits `1`, so it gates CI like a package lockfile. Without `--from`, checks the lock's own integrity. |
|
|
81
83
|
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` | **Canon-rollback compensator.** Flag every dispatch in the corpus whose *Research grounding* cites `<id>` as `evidence-withdrawn` (a tombstone sidecar `<slug>.withdrawn.json` — flag, never delete) and emit a content-addressed withdrawal receipt. `--reason` ∈ `fabricated · misattributed · retracted · verifier-flipped · other`. |
|
|
82
84
|
| `study-swarm requalify --check <corpus-dir>` | Fail closed (exit `1`) for any dispatch carrying an unresolved `evidence-withdrawn` flag — the andon that **halts** a withdrawn finding's dependents until it is removed or re-grounded. Gates CI. |
|
|
85
|
+
| `study-swarm requalify --status <corpus-dir> [--json]` | Read-only evidence-health **view** of a corpus — withdrawn vs resolved counts, a breakdown by reason and resolution mode, per-dispatch lines. Informational (exit `0`), unlike the `--check` gate. |
|
|
83
86
|
| `study-swarm requalify --resolve <dispatch> <id> --mode removed\|regrounded [--note …]` | Clear a flag once the finding is removed (the citation is gone) or re-grounded (re-verified clean by the sibling runner; `--note` records the attestation). Idempotent; appends to the sidecar's audit trail. |
|
|
84
87
|
|
|
85
88
|
`lint` is deterministic — zero model calls — so it's safe in CI. It enforces **Step 3's sourcing standard** locally; the model-based **Step 4** verification still defers to [`roleos verify-citations`](https://github.com/mcp-tool-shop-org/role-os) → prism.
|
|
@@ -104,7 +107,7 @@ Four complete, lint-clean worked dispatches ship as references: [`examples/study
|
|
|
104
107
|
name: study-swarm lint
|
|
105
108
|
on:
|
|
106
109
|
pull_request:
|
|
107
|
-
paths: ['**/*.dispatch.md', '.github/workflows/dispatches.yml']
|
|
110
|
+
paths: ['**/*.dispatch.md', '**/*.withdrawn.json', '.github/workflows/dispatches.yml']
|
|
108
111
|
workflow_dispatch:
|
|
109
112
|
concurrency:
|
|
110
113
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
@@ -112,16 +115,20 @@ concurrency:
|
|
|
112
115
|
jobs:
|
|
113
116
|
lint:
|
|
114
117
|
runs-on: ubuntu-latest
|
|
118
|
+
timeout-minutes: 5
|
|
115
119
|
steps:
|
|
116
120
|
- uses: actions/checkout@v4
|
|
117
121
|
- uses: actions/setup-node@v4
|
|
118
122
|
with: { node-version: '20' }
|
|
119
|
-
- run: npx @dogfood-lab/study-swarm@
|
|
123
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 lint dispatches/
|
|
124
|
+
# Halt the build while any finding that became canon is withdrawn and not yet
|
|
125
|
+
# removed or re-grounded — the canon-rollback andon (exit 1 on any unresolved flag).
|
|
126
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 requalify --check dispatches/
|
|
120
127
|
```
|
|
121
128
|
|
|
122
129
|
### Pin a dispatch for replay (`dispatch.lock.json`)
|
|
123
130
|
|
|
124
|
-
A grounded, verified dispatch is only auditable if you can say *what produced it*. `study-swarm lock` writes a companion lockfile that content-addresses, per research agent, the **resolved model id** (never a floating alias), the **SHA-256 of the
|
|
131
|
+
A grounded, verified dispatch is only auditable if you can say *what produced it*. `study-swarm lock` writes a companion lockfile that content-addresses, per research agent, the **resolved model id** (never a floating alias), the **SHA-256 of the text-normalized prompt** (BOM stripped, newlines folded to LF, NFC), and the **SHA-256 of the tool schema** it was given, plus the external **verifier receipt** — rolled into one `lock_sha256`. `study-swarm lock --verify` re-derives those hashes and fails closed on any drift, so a changed prompt, a swapped model, or a shifted tool surface is caught — the [PIN_PER_STEP](https://github.com/dogfood-lab/study-swarm) reproducibility standard, made executable. The harness emits the record; the CLI stays zero-dependency and network-free, only canonicalizing (RFC 8785), hashing, and validating it.
|
|
125
132
|
|
|
126
133
|
**It pins inputs, not outputs.** Pinning model + prompt + temperature does *not* make an LLM's output bit-identical — batch-invariance, floating-point non-associativity, mixture-of-experts routing, and silent provider drift are all outside an offline tool's control. So the lock gives you **replayable inputs and drift-detectable outputs**, never "deterministic replay." The design is grounded, citation by citation, in [`examples/study-swarm-lock.dispatch.md`](examples/study-swarm-lock.dispatch.md) — the first dispatch to ship its own lock ([`examples/study-swarm-lock.lock.json`](examples/study-swarm-lock.lock.json)).
|
|
127
134
|
|
|
@@ -145,11 +152,11 @@ study-swarm requalify --resolve d.dispatch.md arXiv:2402.15089 --mode removed
|
|
|
145
152
|
|
|
146
153
|
## Security
|
|
147
154
|
|
|
148
|
-
`study-swarm` ships a **thin, zero-dependency CLI** (`study-swarm`) alongside the methodology. It makes **no network or model calls** and collects **no telemetry**; there are no secrets or credentials in the source. At runtime it
|
|
155
|
+
`study-swarm` ships a **thin, zero-dependency CLI** (`study-swarm`) alongside the methodology. It makes **no network or model calls** and collects **no telemetry**; there are no secrets or credentials in the source. At runtime it reads the files you name. `new` writes a single `<slug>.dispatch.md` in the current directory (refusing to overwrite, and never outside that directory). `lock`, `withdraw`, and `requalify` also write a lock file, a tombstone sidecar, and — when you pass `--receipt` — a receipt at the path you give. The model-based verification the methodology describes (Step 4) is run by the sibling tools, not by this package. See [SECURITY.md](SECURITY.md).
|
|
149
156
|
|
|
150
157
|
## Status
|
|
151
158
|
|
|
152
|
-
A working protocol, externally verified by its own machinery — a different model family checks its citations (see the proof above). **v1.1** sharpens the verifier where the first release was silent: decomposed/ternary groundedness, generation-time grounding, an oracle-gated cascade for combining lenses, and calibrated abstention — each grounded in the verified v1.1 dispatch. **v1.2** makes a dispatch byte-replayable: `study-swarm lock` pins the resolved model, prompt, and tool schema per step plus the verifier receipt, and `lock --verify` fails closed on drift. **v1.3** makes the rollback executable: when a finding that already became canon is withdrawn, `study-swarm withdraw` flags every dependent and `requalify --check` halts them fail-closed until they're removed or re-grounded — a named, receipted, idempotent compensator. This repo is the public reference; [PROTOCOL.md](PROTOCOL.md) is the executable shape. Part of the [dogfood-lab](https://github.com/dogfood-lab) family — methods and showcases for building in the AI era.
|
|
159
|
+
A working protocol, externally verified by its own machinery — a different model family checks its citations (see the proof above). **v1.1** sharpens the verifier where the first release was silent: decomposed/ternary groundedness, generation-time grounding, an oracle-gated cascade for combining lenses, and calibrated abstention — each grounded in the verified v1.1 dispatch. **v1.2** makes a dispatch byte-replayable: `study-swarm lock` pins the resolved model, prompt, and tool schema per step plus the verifier receipt, and `lock --verify` fails closed on drift. **v1.3** makes the rollback executable: when a finding that already became canon is withdrawn, `study-swarm withdraw` flags every dependent and `requalify --check` halts them fail-closed until they're removed or re-grounded — a named, receipted, idempotent compensator. **v2.0** makes more of the protocol executable and hardens the lock: `lint --strict` flags orphan citations — the one named failure mode the CLI couldn't catch — `lock --init` scaffolds the harness record, `requalify --status` reads a corpus's evidence health, and the lock's content-addressing is domain-separated (artifact schema v2 — a lock from an earlier version is regenerated rather than mis-flagged as tampered; the CLI's command surface stays backward-compatible). This repo is the public reference; [PROTOCOL.md](PROTOCOL.md) is the executable shape. Part of the [dogfood-lab](https://github.com/dogfood-lab) family — methods and showcases for building in the AI era.
|
|
153
160
|
|
|
154
161
|
MIT licensed.
|
|
155
162
|
|
package/README.pt-BR.md
CHANGED
|
@@ -23,8 +23,8 @@ Ele aplica sua própria abordagem. O protocolo prescreve "envelopes" protegidos
|
|
|
23
23
|
|
|
24
24
|
1. **Identifique** 3 a 5 questões de projeto cruciais, nas quais evidências empíricas mudariam a resposta.
|
|
25
25
|
2. **Envie** um agente de pesquisa por questão, em paralelo. Cada um deve retornar títulos de artigos + autores + anos + URLs + uma descoberta em uma frase — especificidade em vez de amplitude ("6 a 8 descobertas bem fundamentadas superam 20 observações vagas").
|
|
26
|
-
3. **Sintetize** as descobertas em uma seção de *fundamentação da pesquisa
|
|
27
|
-
4. **Verifique externamente** — uma *família de modelos diferente*, sem raciocínio, verifica cada citação em duas etapas: um **oráculo de recuperação** confirma que o artigo existe (nunca a memória do modelo) e, em seguida, uma lente de **validação** confirma que a descoberta corresponde à fonte. **
|
|
26
|
+
3. **Sintetize** as descobertas em uma seção de *Research grounding* (fundamentação da pesquisa): `N. **<descoberta>.** <Autores> <ano> (<arXiv/DOI>). <implicação para o projeto>.`
|
|
27
|
+
4. **Verifique externamente** — uma *família de modelos diferente*, sem raciocínio, verifica cada citação em duas etapas: um **oráculo de recuperação** confirma que o artigo existe (nunca a memória do modelo) e, em seguida, uma lente de **validação** confirma que a descoberta corresponde à fonte. **Descarte** um achado fabricado; **corrija uma atribuição incorreta uma vez** e verifique de novo (um segundo veredito não limpo descarta). **Interrompa e alerte** somente quando o verificador ou o oráculo de recuperação não estiverem disponíveis (nunca interprete a ausência como "citações válidas").
|
|
28
28
|
5. **Conecte** cada escolha arquitetural a uma descoberta por meio de um número. Citações sem implicação para o projeto são ruído.
|
|
29
29
|
|
|
30
30
|
Os detalhes completos e executáveis — a tabela de interrupção, o padrão de referência e a regra do conjunto — estão em **[PROTOCOL.md](PROTOCOL.md)**.
|
|
@@ -75,12 +75,15 @@ npm i -g @dogfood-lab/study-swarm # or run ad-hoc: npx @dogfood-lab/study-sw
|
|
|
75
75
|
|---|---|
|
|
76
76
|
| `study-swarm protocol` | Imprime o protocolo completo – as cinco etapas, a tabela de interrupção e o padrão de referência. |
|
|
77
77
|
| `study-swarm new <slug>` | Cria um arquivo `<slug>.dispatch.md` com o esqueleto das cinco etapas para preencher. |
|
|
78
|
-
| `study-swarm lint [--json] <path…>` |
|
|
79
|
-
| `study-swarm
|
|
78
|
+
| `study-swarm lint [--json] [--strict] <path…>` | Verifique a *Research grounding* (base de pesquisa) de um relatório em relação ao padrão de fontes – cada conclusão deve ter um autor, um ano e um identificador que possa ser localizado (arXiv / DOI / URL / RFC); argumentos vagos do tipo "estudos mostram…" são rejeitados. Retorne `1` em caso de violações, para que isso impeça a execução do CI. Um `<caminho>` pode ser um arquivo, um diretório (verificado recursivamente para `*.dispatch.md`) ou `-` para entrada padrão; `--json` gera um relatório legível por máquina. `--strict` também sinaliza **citações órfãs** – uma conclusão que nenhuma escolha da Etapa 5 referencia –, já que "citações sem conexão são ruído" (opcional, portanto, a configuração padrão do CI permanece inalterada). |
|
|
79
|
+
| `study-swarm return <dispatch> [--check]` | Escreve os resultados: `<stem>.results.md` é a folha que se entrega, e `<stem>.results.json` guarda os mesmos fatos ao lado do dispatch para a próxima execução. `--check` falha se alguma das cópias tiver desviado do dispatch. |
|
|
80
|
+
| `study-swarm lock --init <dispatch>` | Crie o arquivo `<dispatch>.orchestration.json` – um modelo de registro para preencher os campos (uma etapa por agente da Etapa 2) para fornecer ao comando `lock … --from`. |
|
|
81
|
+
| `study-swarm lock <dispatch> --from <orchestration.json>` | Fixe um envio para reprodução – crie o arquivo `<dispatch>.lock.json` com informações de conteúdo, conforme o agente da Etapa 2, incluindo o **ID do modelo resolvido** + o **SHA-256 do prompt normalizado (BOM removido, quebras de linha em LF, NFC)** + o **SHA-256 do esquema da ferramenta**, mais o **comprovante do verificador** da Etapa 4, tudo reunido em um único arquivo `lock_sha256`. |
|
|
80
82
|
| `study-swarm lock --verify <dispatch> [--from …]` | Recalcule esses hashes e verifique se correspondem ao bloqueio; qualquer desvio resulta em saída `1`, portanto, controla o CI como um arquivo de bloqueio de pacote. Sem `--from`, verifica a própria integridade do bloqueio. |
|
|
81
|
-
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` | **Mecanismo de compensação para reversão do canon.** Marcar cada registro no corpus
|
|
83
|
+
| `study-swarm withdraw <id> --reason <reason> [--from <dir>] [--receipt <path>]` | **Mecanismo de compensação para reversão do canon.** Marcar cada registro no corpus cuja seção *Research grounding* (fundamento da pesquisa) cite `<id>` como `evidência-retirada` (um arquivo auxiliar `<slug>.withdrawn.json` — marcar, nunca excluir) e emitir um comprovante de retirada com base no conteúdo. `--reason` ∈ `fabricated · misattributed · retracted · verifier-flipped · other` (fabricado, atribuído incorretamente, revogado, verificador alterado, outro). |
|
|
82
84
|
| `study-swarm requalify --check <corpus-dir>` | Falhar em modo fechado (sair com código `1`) para qualquer registro que contenha uma marcação `evidência-retirada` não resolvida — o sinalizador que **interrompe** os elementos dependentes de um resultado retirado até que seja removido ou reavaliado. Gates CI. |
|
|
83
|
-
| `study-swarm requalify --
|
|
85
|
+
| `study-swarm requalify --status <corpus-dir> [--json]` | Visualização somente leitura do estado de validade das evidências de um corpus – contagem de conclusões retiradas versus resolvidas, uma divisão por motivo e modo de resolução, linhas por relatório. Informativo (retorna `0`), diferente da verificação `--check`. |
|
|
86
|
+
| `study-swarm requalify --resolve <registro> <id> --mode removed\|regrounded [--note …]` | Remover uma marcação assim que o resultado for removido (a citação desaparecer) ou reavaliado (reverificado e validado pelo executor irmão; `--note` registra a confirmação). Idempotente; adiciona ao histórico de auditoria do arquivo auxiliar. |
|
|
84
87
|
|
|
85
88
|
`lint` é determinístico – sem chamadas de modelo – portanto, é seguro no CI. Ele aplica o **padrão de referência da Etapa 3** localmente; a verificação baseada em modelo da **Etapa 4** ainda depende de [`roleos verify-citations`](https://github.com/mcp-tool-shop-org/role-os) → prism.
|
|
86
89
|
|
|
@@ -104,7 +107,7 @@ Quatro registros completos, limpos e funcionais são enviados como referência:
|
|
|
104
107
|
name: study-swarm lint
|
|
105
108
|
on:
|
|
106
109
|
pull_request:
|
|
107
|
-
paths: ['**/*.dispatch.md', '.github/workflows/dispatches.yml']
|
|
110
|
+
paths: ['**/*.dispatch.md', '**/*.withdrawn.json', '.github/workflows/dispatches.yml']
|
|
108
111
|
workflow_dispatch:
|
|
109
112
|
concurrency:
|
|
110
113
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
@@ -112,16 +115,20 @@ concurrency:
|
|
|
112
115
|
jobs:
|
|
113
116
|
lint:
|
|
114
117
|
runs-on: ubuntu-latest
|
|
118
|
+
timeout-minutes: 5
|
|
115
119
|
steps:
|
|
116
120
|
- uses: actions/checkout@v4
|
|
117
121
|
- uses: actions/setup-node@v4
|
|
118
122
|
with: { node-version: '20' }
|
|
119
|
-
- run: npx @dogfood-lab/study-swarm@
|
|
123
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 lint dispatches/
|
|
124
|
+
# Halt the build while any finding that became canon is withdrawn and not yet
|
|
125
|
+
# removed or re-grounded — the canon-rollback andon (exit 1 on any unresolved flag).
|
|
126
|
+
- run: npx --yes @dogfood-lab/study-swarm@2.1.0 requalify --check dispatches/
|
|
120
127
|
```
|
|
121
128
|
|
|
122
129
|
### Fixe um envio para reprodução (`dispatch.lock.json`)
|
|
123
130
|
|
|
124
|
-
Um envio validado e comprovado só pode ser auditado se você puder dizer *o que o gerou*. `study-swarm lock` cria um arquivo de bloqueio complementar que, por meio do agente de pesquisa, contém informações sobre o **ID do modelo resolvido** (nunca um alias flutuante), o **SHA-256 do prompt
|
|
131
|
+
Um envio validado e comprovado só pode ser auditado se você puder dizer *o que o gerou*. `study-swarm lock` cria um arquivo de bloqueio complementar que, por meio do agente de pesquisa, contém informações sobre o **ID do modelo resolvido** (nunca um alias flutuante), o **SHA-256 do prompt normalizado (BOM removido, quebras de linha em LF, NFC)** e o **SHA-256 do esquema da ferramenta** fornecido, mais o **comprovante externo do verificador** – tudo reunido em um único arquivo `lock_sha256`. `study-swarm lock --verify` recalcula esses hashes e falha se houver qualquer desvio, portanto, um prompt alterado, um modelo substituído ou uma ferramenta modificada são detectados – o padrão de reprodutibilidade [PIN_PER_STEP](https://github.com/dogfood-lab/study-swarm), que pode ser executado. O sistema emite o registro; a CLI permanece sem dependências e independente da rede, apenas normalizando (RFC 8785), calculando hashes e validando.
|
|
125
132
|
|
|
126
133
|
**Ele fixa as entradas, não as saídas.** Fixar modelo + prompt + temperatura *não* torna a saída de um LLM bit a bit idêntica – invariância em lote, não associatividade de ponto flutuante, roteamento de mistura de especialistas e desvio silencioso do provedor estão todos fora do controle de uma ferramenta offline. Portanto, o bloqueio fornece **entradas reproduzíveis e saídas com detecção de desvio**, nunca "reprodução determinística". O design é fundamentado, citação por citação, em [`examples/study-swarm-lock.dispatch.md`](examples/study-swarm-lock.dispatch.md) – o primeiro envio a incluir seu próprio bloqueio ([`examples/study-swarm-lock.lock.json`](examples/study-swarm-lock.lock.json)).
|
|
127
134
|
|
|
@@ -145,11 +152,11 @@ study-swarm requalify --resolve d.dispatch.md arXiv:2402.15089 --mode removed
|
|
|
145
152
|
|
|
146
153
|
## Segurança
|
|
147
154
|
|
|
148
|
-
`study-swarm` fornece uma **CLI fina e
|
|
155
|
+
`study-swarm` fornece uma **CLI fina e sem dependências de runtime** (`study-swarm`) junto com a metodologia. Ele não faz **chamadas de rede ou modelo** e não coleta **telemetria**; não há segredos ou credenciais no código-fonte. Em tempo de execução, ele lê os arquivos que você nomeia. `new` grava um único `<slug>.dispatch.md` no diretório de trabalho (sem sobrescrever e sem sair dele). `lock`, `withdraw` e `requalify` também gravam um lock, um sidecar de lápide e, com `--receipt`, um recibo no caminho indicado. A verificação baseada em modelo descrita na metodologia (Etapa 4) é executada pelas ferramentas complementares, não por este pacote. Consulte [SECURITY.md](SECURITY.md).
|
|
149
156
|
|
|
150
157
|
## Status
|
|
151
158
|
|
|
152
|
-
Um protocolo funcional, verificado externamente por
|
|
159
|
+
Um protocolo funcional, verificado externamente por seu próprio mecanismo – uma família de modelos diferente verifica suas citações (veja a prova acima). A **versão 1.1** aprimora o verificador, onde a primeira versão estava silenciosa: base de pesquisa decomposta/ternária, base de pesquisa no momento da geração, um sistema em cascata controlado por um oráculo para combinar lentes e abstinência calibrada – cada um baseado na verificação da versão 1.1 do relatório. A **versão 1.2** torna um relatório reproduzível: `study-swarm lock` fixa o modelo, o prompt e o esquema de ferramentas resolvidos por etapa, além do recibo do verificador, e `lock --verify` falha se houver desvio. A **versão 1.3** torna a reversão executável: quando uma conclusão que já se tornou um padrão é retirada, `study-swarm withdraw` sinaliza todas as dependências e `requalify --check` interrompe sua execução até que sejam removidas ou reavaliadas – um compensador nomeado, com recibo e idempotente. A **versão 2.0** torna mais partes do protocolo executáveis e reforça o bloqueio: `lint --strict` sinaliza citações órfãs – a única falha detectável pela CLI –, `lock --init` cria o modelo de registro, `requalify --status` lê o estado de validade das evidências de um corpus e o endereçamento de conteúdo do bloqueio é separado por domínio (esquema de artefato v2 – um bloqueio de uma versão anterior é regenerado em vez de ser sinalizado incorretamente como adulterado; a interface de linha de comando permanece compatível com versões anteriores). Este repositório é a referência pública; [PROTOCOL.md](PROTOCOL.md) é a forma executável. Parte da família [dogfood-lab](https://github.com/dogfood-lab) – métodos e demonstrações para construir na era da IA.
|
|
153
160
|
|
|
154
161
|
Licenciado sob MIT.
|
|
155
162
|
|