intentional-cognition-os 1.0.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/LICENSE +21 -0
- package/README.md +171 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12989 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/001-initial-schema.sql +136 -0
- package/dist/migrations/002-add-source-hash.sql +9 -0
- package/dist/migrations/003-add-failure-statuses.sql +46 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jeremy Longshore
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# intentional-cognition-os
|
|
2
|
+
|
|
3
|
+
> Compile knowledge for the machine. Distill understanding for the human.
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/jeremylongshore/intentional-cognition-os/actions/workflows/ci.yml)
|
|
7
|
+
[](https://github.com/jeremylongshore/intentional-cognition-os/releases)
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
**Intentional Cognition OS** (`ico`) is a local-first knowledge operating system. You point it at a folder of sources — PDFs, markdown notes, web clips — and it:
|
|
12
|
+
|
|
13
|
+
- Compiles raw corpus into a semantic wiki (concepts, topics, entities, contradictions)
|
|
14
|
+
- Answers grounded questions with inline source citations
|
|
15
|
+
- Spins up scoped episodic workspaces for hard research questions
|
|
16
|
+
- Renders durable artifacts (reports, slides) that you can promote back into the wiki
|
|
17
|
+
- Generates flashcards and quizzes to help you retain what you've ingested
|
|
18
|
+
|
|
19
|
+
It is a cognition runtime, not a chat wrapper. The model proposes; the deterministic kernel owns durable state, traces, and control.
|
|
20
|
+
|
|
21
|
+
## Core loop
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
ingest → compile → reason → render → refine
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Every step writes to an append-only audit trail (SQLite index + JSONL trace files), so the system is inspectable, reproducible, and queryable.
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
### Prerequisites
|
|
32
|
+
|
|
33
|
+
- Node.js **22+**
|
|
34
|
+
- pnpm **10+**
|
|
35
|
+
- An [Anthropic API key](https://console.anthropic.com/) (the system uses Claude for compilation and reasoning)
|
|
36
|
+
|
|
37
|
+
### Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/jeremylongshore/intentional-cognition-os.git
|
|
41
|
+
cd intentional-cognition-os
|
|
42
|
+
pnpm install
|
|
43
|
+
pnpm build
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The CLI binary `ico` is available via `node packages/cli/dist/index.js` after build, or globally after `npm pack && npm install -g intentional-cognition-os-*.tgz`.
|
|
47
|
+
|
|
48
|
+
### First run
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Create a workspace
|
|
52
|
+
ico init my-knowledge
|
|
53
|
+
|
|
54
|
+
# Mount a corpus directory
|
|
55
|
+
ico mount add papers ~/research/papers --workspace my-knowledge
|
|
56
|
+
|
|
57
|
+
# Ingest sources
|
|
58
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
59
|
+
ico ingest ~/research/papers --workspace my-knowledge
|
|
60
|
+
|
|
61
|
+
# Compile semantic knowledge
|
|
62
|
+
ico compile all --workspace my-knowledge
|
|
63
|
+
|
|
64
|
+
# Ask a grounded question
|
|
65
|
+
ico ask "How does self-attention scale with sequence length?" --workspace my-knowledge
|
|
66
|
+
|
|
67
|
+
# Inspect what landed
|
|
68
|
+
ico status --workspace my-knowledge
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## CLI surface
|
|
72
|
+
|
|
73
|
+
| Command | What it does |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `ico init <name>` | Create a new workspace with `wiki/`, `tasks/`, `outputs/`, `recall/`, `audit/`, `.ico/state.db` |
|
|
76
|
+
| `ico mount add\|list\|remove` | Register / inspect / remove corpus mount points |
|
|
77
|
+
| `ico ingest <path>` | Ingest a file or directory into `raw/`. Supports PDF, Markdown, web clips |
|
|
78
|
+
| `ico compile sources\|topics\|all` | Run the six compiler passes (summarize → extract → synthesize → link → contradict → gap) |
|
|
79
|
+
| `ico ask "<question>"` | Retrieval-augmented Q&A grounded in the compiled wiki, with inline citations |
|
|
80
|
+
| `ico research "<brief>"` | Spin up a scoped episodic task: Collector → Summarizer → Skeptic → Integrator → render |
|
|
81
|
+
| `ico research archive <id>` | Archive a completed research task |
|
|
82
|
+
| `ico render report\|slides` | Render artifacts from a topic, task, or set of pages |
|
|
83
|
+
| `ico promote <path> --as <type>` | Promote an L4 artifact into the L2 wiki |
|
|
84
|
+
| `ico unpromote <path>` | Inverse of promote |
|
|
85
|
+
| `ico lint` | Audit compiled knowledge for schema validity, staleness, uncompiled sources, orphans |
|
|
86
|
+
| `ico recall generate --topic <name>` | Generate flashcards + quiz from compiled wiki for a topic |
|
|
87
|
+
| `ico recall quiz --topic <name>` | Run an interactive quiz; supports `--answers-file <json>` for CI |
|
|
88
|
+
| `ico recall weak [--report]` | Show lowest-retention concepts |
|
|
89
|
+
| `ico recall export --format anki [--out <path>]` | Export cards as Anki-importable TSV |
|
|
90
|
+
| `ico eval run [--spec <path>]` | Run YAML eval specs from `evals/`; supports retrieval + smoke handlers |
|
|
91
|
+
| `ico status` | Workspace summary (counts, mounts, tasks, traces) |
|
|
92
|
+
| `ico inspect <subcommand>` | Inspect specific subsystems (tasks, sources, …) |
|
|
93
|
+
|
|
94
|
+
Global flags work on every command: `--workspace <path>`, `--json`, `--verbose`, `--quiet`.
|
|
95
|
+
|
|
96
|
+
## Architecture
|
|
97
|
+
|
|
98
|
+
Six-layer cognition stack:
|
|
99
|
+
|
|
100
|
+
| Layer | Path | What lives here |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| **L1 — Raw Corpus** | `workspace/raw/` | Source-of-truth inputs. Append-only. |
|
|
103
|
+
| **L2 — Semantic Knowledge** | `workspace/wiki/` | Compiled markdown: source summaries, concepts, entities, topics, contradictions, open questions. Recompilable from L1. |
|
|
104
|
+
| **L3 — Episodic Tasks** | `workspace/tasks/<id>/` | Scoped per-question research workspaces. Brief, evidence, notes, critique, output. |
|
|
105
|
+
| **L4 — Artifacts** | `workspace/outputs/` | Rendered reports, slides, briefings. Promotable to L2. |
|
|
106
|
+
| **L5 — Recall** | `workspace/recall/` | Flashcards, quizzes, retention scores. Adaptive. |
|
|
107
|
+
| **L6 — Audit & Policy** | `workspace/audit/` | Append-only trace JSONL + audit log. Deterministic control plane. |
|
|
108
|
+
|
|
109
|
+
The **deterministic vs probabilistic boundary** is the most important constraint:
|
|
110
|
+
|
|
111
|
+
- **Deterministic** (Kernel + SQLite + JSONL): file storage, mount registry, task state, provenance, policy, permissions, audit, promotion rules, eval execution.
|
|
112
|
+
- **Probabilistic** (Compiler + Claude API): summarization, synthesis, concept extraction, contradiction detection, question decomposition, artifact drafting, recall generation.
|
|
113
|
+
|
|
114
|
+
The model never directly writes to audit, policy, or promotion tables. It proposes; the kernel decides.
|
|
115
|
+
|
|
116
|
+
## Development
|
|
117
|
+
|
|
118
|
+
| | |
|
|
119
|
+
|---|---|
|
|
120
|
+
| **Build all packages** | `pnpm build` |
|
|
121
|
+
| **Run full test suite** | `pnpm test` |
|
|
122
|
+
| **Lint** | `pnpm lint` |
|
|
123
|
+
| **Typecheck** | `pnpm typecheck` |
|
|
124
|
+
| **Coverage** | `pnpm test:coverage` |
|
|
125
|
+
| **Single test file** | `pnpm --filter @ico/<package> test -- <file>` |
|
|
126
|
+
|
|
127
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for full development setup, coding conventions, and PR process.
|
|
128
|
+
|
|
129
|
+
## Documentation
|
|
130
|
+
|
|
131
|
+
Standards and design documents live in [`000-docs/`](000-docs/):
|
|
132
|
+
|
|
133
|
+
| Doc | Purpose |
|
|
134
|
+
|---|---|
|
|
135
|
+
| [Business Case](000-docs/001-PP-BCASE-business-case.md) | Problem, market, ROI |
|
|
136
|
+
| [PRD](000-docs/002-PP-PRD-product-requirements.md) | Requirements & user stories |
|
|
137
|
+
| [Architecture](000-docs/003-AT-ARCH-architecture.md) | System design & data flow |
|
|
138
|
+
| [User Journey](000-docs/004-PP-UJRN-user-journey.md) | Walkthrough & personas |
|
|
139
|
+
| [Technical Spec](000-docs/005-AT-SPEC-technical-spec.md) | Stack, APIs, deployment |
|
|
140
|
+
| [Master Blueprint](000-docs/007-PP-PLAN-master-blueprint.md) | Authoritative design document |
|
|
141
|
+
| [Glossary](000-docs/008-AT-GLOS-glossary.md) | Canonical terminology |
|
|
142
|
+
| [Frontmatter Schemas](000-docs/009-AT-FMSC-frontmatter-schemas.md) | YAML schemas for all compiled page types |
|
|
143
|
+
| [Database Schema](000-docs/010-AT-DBSC-database-schema.md) | SQLite DDL + migration strategy |
|
|
144
|
+
| [Trace Schema](000-docs/011-AT-TRSC-trace-schema.md) | JSONL event envelope + event types |
|
|
145
|
+
| [Workspace Policy](000-docs/012-AT-WPOL-workspace-policy.md) | Directory layout + naming |
|
|
146
|
+
| [Coding Standards](000-docs/013-AT-CODE-coding-standards.md) | TypeScript conventions |
|
|
147
|
+
| [Testing Strategy](000-docs/015-AT-TEST-testing-strategy.md) | Test layers + coverage targets |
|
|
148
|
+
| [Promotion Rules](000-docs/018-AT-PROM-promotion-spec.md) | L4 → L2 promotion logic |
|
|
149
|
+
| [Trace Coverage Audit](000-docs/023-OD-AUDIT-trace-coverage-2026-05-15.md) | Per-command trace-emission audit (E10-B04) |
|
|
150
|
+
|
|
151
|
+
## Roadmap
|
|
152
|
+
|
|
153
|
+
| Phase | Status |
|
|
154
|
+
|---|---|
|
|
155
|
+
| Phase 1 — Local-first MVP (Epics 1–9) | ✅ Complete |
|
|
156
|
+
| Phase 2 — Hardening & v1.0 release (Epic 10) | 🚧 In progress |
|
|
157
|
+
| Phase 3 — Remote/cloud features | Future |
|
|
158
|
+
| Phase 4 — Multi-user collaboration | Future |
|
|
159
|
+
| Phase 5 — Plugin system | Future |
|
|
160
|
+
|
|
161
|
+
## Security
|
|
162
|
+
|
|
163
|
+
See [SECURITY.md](SECURITY.md) for vulnerability reporting.
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT — see [LICENSE](LICENSE).
|
|
168
|
+
|
|
169
|
+
## Author
|
|
170
|
+
|
|
171
|
+
Jeremy Longshore · [intentsolutions.io](https://intentsolutions.io)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
declare const cliVersion: string;
|
|
4
|
+
declare function buildProgram(): Command;
|
|
5
|
+
/** Register the process-level error and signal handlers. Idempotent. */
|
|
6
|
+
declare function installProcessHandlers(): void;
|
|
7
|
+
|
|
8
|
+
export { buildProgram, cliVersion, installProcessHandlers };
|