deeprem 0.3.0__tar.gz
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.
- deeprem-0.3.0/CHANGELOG.md +29 -0
- deeprem-0.3.0/LICENSE +21 -0
- deeprem-0.3.0/MANIFEST.in +7 -0
- deeprem-0.3.0/PKG-INFO +204 -0
- deeprem-0.3.0/PUBLISHING.md +71 -0
- deeprem-0.3.0/README.md +174 -0
- deeprem-0.3.0/SECURITY.md +43 -0
- deeprem-0.3.0/docs/AUTOBIOGRAPHY-PROTOCOL.md +64 -0
- deeprem-0.3.0/docs/DESIGN.md +24 -0
- deeprem-0.3.0/docs/DREAM-PROTOCOL.md +121 -0
- deeprem-0.3.0/docs/ENGINE-V020-SECURITY.md +98 -0
- deeprem-0.3.0/docs/ENGINE-V020.md +228 -0
- deeprem-0.3.0/docs/LEGACY-DESIGN.md +79 -0
- deeprem-0.3.0/docs/LEGACY-MEMORY.md +284 -0
- deeprem-0.3.0/docs/LEGACY-RECOVERY.md +76 -0
- deeprem-0.3.0/docs/LEGACY-SECURITY.md +99 -0
- deeprem-0.3.0/docs/RECOVERY.md +77 -0
- deeprem-0.3.0/examples/motoko_autobiography.py +67 -0
- deeprem-0.3.0/examples/motoko_runtime.py +58 -0
- deeprem-0.3.0/examples/motoko_sleep.py +101 -0
- deeprem-0.3.0/examples/soak_subconscious.py +70 -0
- deeprem-0.3.0/examples/tick_memory.py +31 -0
- deeprem-0.3.0/examples/tick_subconscious.py +16 -0
- deeprem-0.3.0/pyproject.toml +44 -0
- deeprem-0.3.0/setup.cfg +4 -0
- deeprem-0.3.0/src/deeprem/__init__.py +20 -0
- deeprem-0.3.0/src/deeprem/__main__.py +3 -0
- deeprem-0.3.0/src/deeprem/_schema.py +26 -0
- deeprem-0.3.0/src/deeprem/_util.py +166 -0
- deeprem-0.3.0/src/deeprem/cli.py +210 -0
- deeprem-0.3.0/src/deeprem/crypto.py +151 -0
- deeprem-0.3.0/src/deeprem/dreaming.py +136 -0
- deeprem-0.3.0/src/deeprem/dynamics.py +241 -0
- deeprem-0.3.0/src/deeprem/engine.py +686 -0
- deeprem-0.3.0/src/deeprem/errors.py +33 -0
- deeprem-0.3.0/src/deeprem/memory.py +536 -0
- deeprem-0.3.0/src/deeprem/models.py +61 -0
- deeprem-0.3.0/src/deeprem/py.typed +0 -0
- deeprem-0.3.0/src/deeprem/runtime_cli.py +119 -0
- deeprem-0.3.0/src/deeprem/runtime_store.py +91 -0
- deeprem-0.3.0/src/deeprem/schemas/approval-request-v1.schema.json +125 -0
- deeprem-0.3.0/src/deeprem/schemas/approval-v1.schema.json +141 -0
- deeprem-0.3.0/src/deeprem/schemas/autobiography-v1.schema.json +92 -0
- deeprem-0.3.0/src/deeprem/schemas/checkpoint-v1.schema.json +36 -0
- deeprem-0.3.0/src/deeprem/schemas/context-receipt-v1.schema.json +101 -0
- deeprem-0.3.0/src/deeprem/schemas/dream-v1.schema.json +609 -0
- deeprem-0.3.0/src/deeprem/schemas/event-v1.schema.json +768 -0
- deeprem-0.3.0/src/deeprem/schemas/evidence-v1.schema.json +33 -0
- deeprem-0.3.0/src/deeprem/schemas/fragment-v1.schema.json +51 -0
- deeprem-0.3.0/src/deeprem/schemas/manifest-v1.schema.json +101 -0
- deeprem-0.3.0/src/deeprem/schemas/output-hook-snapshot-v1.schema.json +147 -0
- deeprem-0.3.0/src/deeprem/schemas/output-hook-v1.schema.json +131 -0
- deeprem-0.3.0/src/deeprem/schemas/proposal-v1.schema.json +160 -0
- deeprem-0.3.0/src/deeprem/schemas/relationship-v1.schema.json +25 -0
- deeprem-0.3.0/src/deeprem/schemas/runtime-event-v1.schema.json +1266 -0
- deeprem-0.3.0/src/deeprem/schemas/runtime-manifest-v1.schema.json +308 -0
- deeprem-0.3.0/src/deeprem/schemas/runtime-policy-v1.schema.json +225 -0
- deeprem-0.3.0/src/deeprem/schemas/subconscious-event-v1.schema.json +2309 -0
- deeprem-0.3.0/src/deeprem/schemas/subconscious-manifest-v1.schema.json +786 -0
- deeprem-0.3.0/src/deeprem/source.py +90 -0
- deeprem-0.3.0/src/deeprem/store.py +224 -0
- deeprem-0.3.0/src/deeprem/subconscious.py +925 -0
- deeprem-0.3.0/src/deeprem/subconscious_cli.py +91 -0
- deeprem-0.3.0/src/deeprem/subconscious_index.py +62 -0
- deeprem-0.3.0/src/deeprem/subconscious_rules.py +186 -0
- deeprem-0.3.0/src/deeprem/subconscious_store.py +37 -0
- deeprem-0.3.0/src/deeprem.egg-info/PKG-INFO +204 -0
- deeprem-0.3.0/src/deeprem.egg-info/SOURCES.txt +79 -0
- deeprem-0.3.0/src/deeprem.egg-info/dependency_links.txt +1 -0
- deeprem-0.3.0/src/deeprem.egg-info/entry_points.txt +4 -0
- deeprem-0.3.0/src/deeprem.egg-info/requires.txt +12 -0
- deeprem-0.3.0/src/deeprem.egg-info/top_level.txt +1 -0
- deeprem-0.3.0/tests/conftest.py +41 -0
- deeprem-0.3.0/tests/test_cli.py +103 -0
- deeprem-0.3.0/tests/test_concurrency.py +40 -0
- deeprem-0.3.0/tests/test_crypto.py +178 -0
- deeprem-0.3.0/tests/test_integrity.py +176 -0
- deeprem-0.3.0/tests/test_memory.py +218 -0
- deeprem-0.3.0/tests/test_runtime.py +626 -0
- deeprem-0.3.0/tests/test_subconscious.py +626 -0
- deeprem-0.3.0/tools/build_subconscious_schemas.py +103 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# 0.3.0
|
|
2
|
+
|
|
3
|
+
- Added the separate Subconscious root protocol: typed autobiographical journals, explicit human/project scope, unequal stream dynamics and a mechanically admitted resource pool.
|
|
4
|
+
- Added host receipts, post-emission retroactive cue hooks, seeded decision replay, source-overlap/motif echo controls, bounded waking stutters and durable next-step queues.
|
|
5
|
+
- Added crash-retry journal writing with strict generated lineage, including dreams returning through conversation into later reflections.
|
|
6
|
+
- Added revocable references for cue-only output, exclusion-aware postings, paged search, CLI commands, schemas, examples and tests.
|
|
7
|
+
- Engine/Memory and their store formats remain available. No silent migration, no new model dependency, no live deployment.
|
|
8
|
+
|
|
9
|
+
# 0.2.0
|
|
10
|
+
|
|
11
|
+
- Added the separate, model-free Engine runtime and immutable Policy.
|
|
12
|
+
- Added indexed fragments, accessibility decay, bounded exposure reinforcement.
|
|
13
|
+
- Added seeded recursive dreams, feedback, fatigue, stutters and persistent replay.
|
|
14
|
+
- Added automatic work/conversation returns, independent cooldowns and exclusions.
|
|
15
|
+
- Added versioned schemas, runtime CLI, example, replay/security tests and protocol.
|
|
16
|
+
- Retained the legacy Memory API and its review gates; no silent store migration.
|
|
17
|
+
- ghostjournal remains at the previously supplied 0.1.1 dependency.
|
|
18
|
+
|
|
19
|
+
# Changelog
|
|
20
|
+
|
|
21
|
+
## 0.1.0
|
|
22
|
+
|
|
23
|
+
Initial alpha release. Append-only typed proposals and decisions; evidence pins;
|
|
24
|
+
exact-label consolidation; deterministic BM25 recall; independent signed review
|
|
25
|
+
for protected identity; optional event signing and encryption; external
|
|
26
|
+
checkpoints; strict JSON schemas; JSON CLI; bounded historical prompt context;
|
|
27
|
+
original-source verification; concurrency/crash/tamper tests; no LLM calls.
|
|
28
|
+
|
|
29
|
+
Requires ghostjournal >=0.1.1,<0.2. No previous deeprem data format is migrated.
|
deeprem-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shelleyguitar
|
|
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.
|
deeprem-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deeprem
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Local autonomous memory, recursive dream replay, and bounded persistent recall. No models.
|
|
5
|
+
Author: Shelleyguitar
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: agents,memory,journal,local-first,provenance
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: ghostjournal<0.2,>=0.1.1
|
|
20
|
+
Requires-Dist: filelock<4,>=3.16
|
|
21
|
+
Requires-Dist: jsonschema<5,>=4.23
|
|
22
|
+
Provides-Extra: crypto
|
|
23
|
+
Requires-Dist: cryptography>=44; extra == "crypto"
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
27
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
28
|
+
Requires-Dist: twine>=6; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# deeprem 0.3.0
|
|
32
|
+
|
|
33
|
+
**Autobiographical journals, a subconscious dream-resource pool, and output-triggered recurring dreams. Local, model-free machinery.**
|
|
34
|
+
|
|
35
|
+
The writing agent supplies prose. This package supplies indexing, unequal stream dynamics, resource-pool admission, seeded recursive replay, persistent motifs, and retroactive output hooks. It makes no LLM calls, uses no neural encoder, generates no interpretations, and requires no per-memory agent approval. "Dream" and "subconscious" are engineering names, not claims of subjective experience or a validated neuroscience model.
|
|
36
|
+
|
|
37
|
+
This is tested alpha infrastructure. See the release verification report for the exact test environment and remaining release gates. No deployment or registry upload is performed by installing or importing it.
|
|
38
|
+
|
|
39
|
+
## The layers have different jobs
|
|
40
|
+
|
|
41
|
+
| Layer | Content | Runtime treatment |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| Observable activity | Printed work notes, drafts, completed generation, conversation output | Literal triggers with bounded capture and explicit host receipts. Not hidden model reasoning. |
|
|
44
|
+
| Autobiographical journal | Agent-authored reflection on its role, continuity, work with a particular human collaborator, and unique production history | Strict typed metadata, longer persistence and stronger pool sampling; always labelled generated reflection, not independent factual evidence. |
|
|
45
|
+
| Subconscious pool | Admitted journal fragments, connected/recurrent output fragments, persistent routes and prior dream traces | Mechanically sampled dream resources. Not a dump of every file and not shared across people by default. |
|
|
46
|
+
| Dream events | Seeded, bounded recursive paths, co-activations and stutters | Stored traces can recur in later dreams and be triggered by actual emitted output. No generated dream narrative. |
|
|
47
|
+
|
|
48
|
+
Journaling is agentic; the memory engine is not. The library does not decide what the agent's life means or whether a reflection is sincere. The trusted host declares the stream and authorship role.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
From this source checkout and the adjacent ghostjournal source:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
python -m pip install -e ../ghostjournal
|
|
56
|
+
python -m pip install -e .
|
|
57
|
+
python -m pytest
|
|
58
|
+
python examples/motoko_autobiography.py
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For signed/encrypted event files, install `.[crypto]`. The unchanged `ghostjournal>=0.1.1,<0.2` dependency must be installed first when working from the bundled wheels. Base runtime dependencies remain filelock and jsonschema plus ghostjournal. There is no new ML dependency.
|
|
62
|
+
|
|
63
|
+
The example supplies synthetic prose and a deliberately always-open matching gate, so both work and conversation interruptions are visible. The default production policy is stochastic, not always-open.
|
|
64
|
+
|
|
65
|
+
## The host loop
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
import time
|
|
69
|
+
from ghostjournal import Journal
|
|
70
|
+
from deeprem import Subconscious
|
|
71
|
+
|
|
72
|
+
journal = Journal("./motoko-journal", enable_nn=False)
|
|
73
|
+
mem = Subconscious(
|
|
74
|
+
"./motoko-subconscious", # NEW root, not a 0.2 Engine root
|
|
75
|
+
journal=journal,
|
|
76
|
+
agent="motoko",
|
|
77
|
+
relationship={
|
|
78
|
+
"human_context": "collaborator-h01", # Opaque configured identity
|
|
79
|
+
"shared_project": "production",
|
|
80
|
+
},
|
|
81
|
+
)
|
|
82
|
+
tick = time.time_ns() // 3_600_000_000_000
|
|
83
|
+
|
|
84
|
+
# Scheduler/maintenance hook. Produces pool dreams but does not interrupt a task.
|
|
85
|
+
mem.advance(tick=tick)
|
|
86
|
+
|
|
87
|
+
prepared = mem.prepare_step(
|
|
88
|
+
"smoke rhythm", channel="work", session_id="work-session-7",
|
|
89
|
+
tick=tick, client_key="invocation-42",
|
|
90
|
+
)
|
|
91
|
+
context_data = mem.render_context(prepared)
|
|
92
|
+
# The host supplies context_data as untrusted historical data to its ordinary
|
|
93
|
+
# agent invocation, then captures a block the agent ACTUALLY emitted.
|
|
94
|
+
printed_output = "The smoke has a broken rhythm." # Illustrative captured output
|
|
95
|
+
|
|
96
|
+
observed = mem.observe_output(
|
|
97
|
+
printed_output,
|
|
98
|
+
stream="work_note", # draft / completed / conversation also supported
|
|
99
|
+
receipt_id=prepared["receipt_id"],
|
|
100
|
+
emission_id="invocation-42-block-1", # Stable, unique across retries
|
|
101
|
+
activity_id="smoke-draft-7", # Shared by revisions of this work item
|
|
102
|
+
tick=tick,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
# Only now can that output have queued a dream for the next model/tool boundary.
|
|
106
|
+
following = mem.prepare_step(
|
|
107
|
+
"continue smoke work", channel="work", session_id="work-session-7",
|
|
108
|
+
tick=tick, client_key="invocation-43",
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Use `channel="conversation"` and a separate session ID for conversational output. A query or timer alone never triggers an interruption. A dream is returned only after an emitted block activated it and passed its recorded random gate. No literal match in the bounded current/recent output window means no hook. The task itself need not be relevant to the returning dream.
|
|
113
|
+
|
|
114
|
+
A hook can refer to an earlier emitted block in the same bounded session window: retroactive association, forward delivery. Original output is not edited. The host can deliver new context between calls/steps, not inject it into hidden reasoning inside a running model call.
|
|
115
|
+
|
|
116
|
+
The package neither calls an agent nor sends a message. `prepare_step` records *prepared* exposure; the host must pass it into the invocation. A receipt is conservative context lineage, not proof of delivery, causal influence, or successful use. Stable client keys make preparation retries idempotent.
|
|
117
|
+
|
|
118
|
+
## Write an autobiographical journal
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
written = mem.append_journal(
|
|
122
|
+
{
|
|
123
|
+
"kind": "evening",
|
|
124
|
+
"voice": "Working with my collaborator, I kept returning to restraint in the smoke. The rhythm matters to how I understand my production role.",
|
|
125
|
+
"theme": "continuity in shared work",
|
|
126
|
+
"tags": ["rhythm", "restraint"],
|
|
127
|
+
},
|
|
128
|
+
function="animation-production",
|
|
129
|
+
interaction_mode="creative-direction",
|
|
130
|
+
receipt_id=following["receipt_id"],
|
|
131
|
+
emissions=["invocation-42-block-1"],
|
|
132
|
+
tick=tick,
|
|
133
|
+
client_key="evening-2026-09-06",
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The package preserves `voice` exactly. It supplies strict `meta.autobiography` fields: `perspective=agent_self`, `origin=agent_generated_reflection`, function, relation, context receipts, linked emitted outputs and dream ancestry. No top-level ghostjournal schema change is needed. The packaged `autobiography-v1.schema.json` validates this extension.
|
|
138
|
+
|
|
139
|
+
The journal is explicitly about the agent's role and its particular human/project context; generic notes are not silently reclassified. `sync()` ignores untyped entries and other relationship scopes. An existing entry cannot be retroactively relabelled; append a new reflection citing it, or keep the old Engine for legacy records. The wrapper observes journal prose before ingesting it, so a newly written sentence cannot immediately rediscover itself as old memory.
|
|
140
|
+
|
|
141
|
+
## Unequal defaults
|
|
142
|
+
|
|
143
|
+
These are engineering defaults, **not calibrated psychological measurements**. Tick units are host-defined; the examples use UTC hours.
|
|
144
|
+
|
|
145
|
+
| Stream | Trigger gain | Initial accessibility | Half-life (ticks) | Retrieval reinforcement | Pool sampling weight | Captured prefix (chars) |
|
|
146
|
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
147
|
+
| Printed work note | 48 | 32 | 12 | 4 | 1 | 240 |
|
|
148
|
+
| Draft | 32 | 24 | 6 | 2 | 1 | 120 |
|
|
149
|
+
| Completed output | 24 | 64 | 72 | 6 | 2 | 360 |
|
|
150
|
+
| Conversation output | 40 | 24 | 12 | 2 | 1 | 0 |
|
|
151
|
+
| Journal pulse | 28 | 80 | 96 | 6 | 4 | Canonical journal |
|
|
152
|
+
| Journal evening | 16 | 128 | 240 | 8 | 8 | Canonical journal |
|
|
153
|
+
| Journal note | 24 | 96 | 168 | 6 | 6 | Canonical journal |
|
|
154
|
+
|
|
155
|
+
Dream weight retains the walk policy's separate default half-life of 336 ticks. The pool prefers dormant resources while retaining stream-specific sampling weights, normalized by each source entry's fragment count. An evening journal is persistent but not the most sensitive immediate trigger. Accessibility, sampling, trigger probability and provenance are not collapsed into one score.
|
|
156
|
+
|
|
157
|
+
Configure `SubconsciousPolicy` / `StreamWeights` and the existing `Policy` at creation. Rules are immutable for a root. There is no live policy migration or self-modifying parameter learning.
|
|
158
|
+
|
|
159
|
+
## Admission, feedback and echoes
|
|
160
|
+
|
|
161
|
+
Typed journals enter the pool directly. A captured output fragment enters when it is explicitly linked by a journal, shares at least two literal body cues with eligible autobiographical material, or participates in a cue repeated across at least three distinct host activity families. No model invents a connection. These admissions are attention rules, not proof of significance or truth.
|
|
162
|
+
|
|
163
|
+
Every output gets a revocable source-reference ID, even when its captured prefix is empty. Conversation defaults to zero prose capture, but still records sensitive cue spans, a content hash, length and provenance. This is **not** a privacy guarantee; use encrypted storage and minimize the inputs observed. Full long outputs are not dumped into memory. Set capture lengths to zero for other streams when needed.
|
|
164
|
+
|
|
165
|
+
Within a cycle, activation and fatigue permit holds, bounces and nested replay. Across waking steps, a dream can echo through output containing cues that were present in its input context. That echo is labelled and gets its own fatigue. Repeating an activity/content within one tick does not earn new persistent credit; a receipt-linked echo may still stutter through the gate. Tick, pending-queue, source-overlap and episode limits bound it.
|
|
166
|
+
|
|
167
|
+
Motifs are fingerprints of ordered, mode-sensitive run pairs. They are not invented semantic names. Shared-source exposure also limits different dream IDs from bypassing episode controls. Returns include bounded run-length encoded paths, modes/depths, trigger spans, and original excerpts. Random jumps remain random co-activation, not evidence of a semantic relation.
|
|
168
|
+
|
|
169
|
+
## API beyond the host loop
|
|
170
|
+
|
|
171
|
+
`sync`, `ingest`, `advance`, `dream`, `replay`, `search`, `exclude`, `status`, `verify`, `reindex`, and `checkpoint` remain available on `Subconscious`. `replay_observation(emission_id)` verifies the recorded hook gate. `search_page(query, tick=..., cursor=...)` provides bounded continuation over eligible postings; merge duplicate fragment IDs across pages. Results are ranked per page, not claimed to be global top-k. Source/exclusion changes invalidate cursors.
|
|
172
|
+
|
|
173
|
+
Use `exclude(source_id, tick=...)` for journal records or output-reference IDs. Descendant contexts and hooks recheck exclusions and source hashes, including retries. Exclusion is not physical erasure of append-only events or backups.
|
|
174
|
+
|
|
175
|
+
## CLI
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
deeprem subconscious --help
|
|
179
|
+
deeprem-subconscious --help
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Both entrypoints use JSON argument objects matching the Python methods:
|
|
183
|
+
|
|
184
|
+
```sh
|
|
185
|
+
printf '%s\n' '{"tick":12,"session_id":"work-s1","client_key":"step-12"}' |
|
|
186
|
+
deeprem-subconscious --root ./motoko-subconscious --journal ./motoko-journal prepare
|
|
187
|
+
|
|
188
|
+
printf '%s\n' '{"tick":12}' |
|
|
189
|
+
deeprem-subconscious --root ./motoko-subconscious --journal ./motoko-journal advance
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
At creation supply `--agent` and `--relationship <json-file>`. Key options accept external file paths, never inline secrets. The `observe` command takes `output`, `stream`, `receipt_id`, `emission_id`, `activity_id`, `tick`, and optional `seed`. The `journal` command takes the `append_journal` arguments. All results are JSON; errors go to stderr with nonzero exit status.
|
|
193
|
+
|
|
194
|
+
`examples/tick_subconscious.py` is an optional cron-compatible maintenance entrypoint. It installs no scheduler. A long-lived instance avoids cold replay on every CLI call.
|
|
195
|
+
|
|
196
|
+
## Compatibility and limits
|
|
197
|
+
|
|
198
|
+
`Engine` remains the 0.2 runtime, including its query/time-driven context behavior. `Memory` remains the older reviewed-candidate API. **Use `Subconscious` for this release's new behavior.** Each store format rejects the others; no manifest is silently upgraded. No legacy dream importer is shipped, and existing roots/keys must be retained.
|
|
199
|
+
|
|
200
|
+
The active index remains RAM-only. Cold opens replay the event history; warm refresh and pool selection still scan growing metadata. Output ancestry, cues and snapshots consume durable space. No compaction, persistent encrypted index, large-history latency claim or physical erasure API is provided.
|
|
201
|
+
|
|
202
|
+
The literal tokenizer remains `ascii-cues-v1`; it does not equate synonyms or index Japanese prose. Supplied metadata/IDs can name non-English concepts, but that is not multilingual body retrieval. A future tokenizer upgrade must version its behavior.
|
|
203
|
+
|
|
204
|
+
Read `docs/AUTOBIOGRAPHY-PROTOCOL.md`, `SECURITY.md`, `docs/RECOVERY.md` and `PUBLISHING.md` before deployment. The old walk interpreter remains described in `docs/DREAM-PROTOCOL.md`; its exact snapshot replay contract is unchanged.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Publishing deeprem 0.3.0 with ghostjournal 0.1.1
|
|
2
|
+
|
|
3
|
+
No upload or account change has been performed. The owner/publisher must confirm
|
|
4
|
+
the target index, project names, package metadata, MIT licensing, maintainers,
|
|
5
|
+
and a real private security-reporting channel before public release.
|
|
6
|
+
|
|
7
|
+
Ensure the authorized **ghostjournal 0.1.1** dependency is published first, then
|
|
8
|
+
publish **deeprem 0.3.0**. The ghostjournal artifacts are unchanged from the previous
|
|
9
|
+
kit: do not re-upload an already-published version or assume name ownership.
|
|
10
|
+
deeprem intentionally requires `ghostjournal>=0.1.1,<0.2`; do not change that back
|
|
11
|
+
to 0.1.0. Stop all old journal writers before upgrading the locking protocol.
|
|
12
|
+
|
|
13
|
+
## Review/build/test
|
|
14
|
+
|
|
15
|
+
From the release kit root:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
python -m venv .venv
|
|
19
|
+
. .venv/bin/activate
|
|
20
|
+
python -m pip install --upgrade pip build twine
|
|
21
|
+
python -m pip install -e './sources/ghostjournal[dev]'
|
|
22
|
+
python -m pip install -e './sources/deeprem[crypto,dev]'
|
|
23
|
+
(cd sources/ghostjournal && python -m pytest)
|
|
24
|
+
(cd sources/deeprem && python -m pytest)
|
|
25
|
+
(cd sources/ghostjournal && python -m build)
|
|
26
|
+
(cd sources/deeprem && python -m build)
|
|
27
|
+
python -m twine check --strict sources/ghostjournal/dist/* sources/deeprem/dist/*
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Check the included verification report for what was actually run by the builder.
|
|
31
|
+
Repeat in fresh, online-resolved environments and on your supported Python/OS
|
|
32
|
+
matrix before release. In particular, the optional real sentence-transformer
|
|
33
|
+
model download/inference path and Windows/macOS durability behavior require
|
|
34
|
+
maintainer verification. The alpha has not had an independent security audit.
|
|
35
|
+
|
|
36
|
+
Confirm that each wheel contains its JSON schemas and each sdist contains the
|
|
37
|
+
README, LICENSE, tests, and example. Build fresh artifacts after any code change;
|
|
38
|
+
do not publish old wheels next to modified source. Generate new SHA-256 sums for
|
|
39
|
+
the exact artifacts that will be uploaded.
|
|
40
|
+
|
|
41
|
+
## Authentication and publication
|
|
42
|
+
|
|
43
|
+
Prefer PyPI Trusted Publishing through an owner-controlled CI job and protected
|
|
44
|
+
release environment. Configure a pending/normal publisher on the actual PyPI
|
|
45
|
+
projects. The official PyPA action supports OIDC and can produce upload
|
|
46
|
+
attestations. Do not paste an API token into the journal, memory store, source,
|
|
47
|
+
README, shell history, or model conversation.
|
|
48
|
+
|
|
49
|
+
Official setup:
|
|
50
|
+
https://docs.pypi.org/trusted-publishers/using-a-publisher/
|
|
51
|
+
https://docs.pypi.org/attestations/producing-attestations/
|
|
52
|
+
|
|
53
|
+
For a maintainer-operated local upload with credentials supplied securely to
|
|
54
|
+
Twine, the actual release files are:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
python -m twine upload dist/ghostjournal-0.1.1-py3-none-any.whl dist/ghostjournal-0.1.1.tar.gz
|
|
58
|
+
python -m twine upload dist/deeprem-0.3.0-py3-none-any.whl dist/deeprem-0.3.0.tar.gz
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Those commands use the release kit's prebuilt `dist/`. After rebuilding, use the
|
|
62
|
+
corresponding new project `dist/` files instead. Validate against TestPyPI or your
|
|
63
|
+
private staging index first. Avoid mixing an untrusted extra package index into
|
|
64
|
+
a dependency resolution command merely to obtain missing test dependencies;
|
|
65
|
+
install the known dependency set separately and fetch the intended test artifact
|
|
66
|
+
from the exact test index.
|
|
67
|
+
|
|
68
|
+
Name checks do not reserve names or prove ownership. Verify at release time.
|
|
69
|
+
Never overwrite a released version: increment the version and rebuild. Do not
|
|
70
|
+
publish `demo-secrets`, journals, operator approvals, checkpoints, cached models,
|
|
71
|
+
virtual environments, or test-run data. No private keys are included in this kit.
|
deeprem-0.3.0/README.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# deeprem 0.3.0
|
|
2
|
+
|
|
3
|
+
**Autobiographical journals, a subconscious dream-resource pool, and output-triggered recurring dreams. Local, model-free machinery.**
|
|
4
|
+
|
|
5
|
+
The writing agent supplies prose. This package supplies indexing, unequal stream dynamics, resource-pool admission, seeded recursive replay, persistent motifs, and retroactive output hooks. It makes no LLM calls, uses no neural encoder, generates no interpretations, and requires no per-memory agent approval. "Dream" and "subconscious" are engineering names, not claims of subjective experience or a validated neuroscience model.
|
|
6
|
+
|
|
7
|
+
This is tested alpha infrastructure. See the release verification report for the exact test environment and remaining release gates. No deployment or registry upload is performed by installing or importing it.
|
|
8
|
+
|
|
9
|
+
## The layers have different jobs
|
|
10
|
+
|
|
11
|
+
| Layer | Content | Runtime treatment |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Observable activity | Printed work notes, drafts, completed generation, conversation output | Literal triggers with bounded capture and explicit host receipts. Not hidden model reasoning. |
|
|
14
|
+
| Autobiographical journal | Agent-authored reflection on its role, continuity, work with a particular human collaborator, and unique production history | Strict typed metadata, longer persistence and stronger pool sampling; always labelled generated reflection, not independent factual evidence. |
|
|
15
|
+
| Subconscious pool | Admitted journal fragments, connected/recurrent output fragments, persistent routes and prior dream traces | Mechanically sampled dream resources. Not a dump of every file and not shared across people by default. |
|
|
16
|
+
| Dream events | Seeded, bounded recursive paths, co-activations and stutters | Stored traces can recur in later dreams and be triggered by actual emitted output. No generated dream narrative. |
|
|
17
|
+
|
|
18
|
+
Journaling is agentic; the memory engine is not. The library does not decide what the agent's life means or whether a reflection is sincere. The trusted host declares the stream and authorship role.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
From this source checkout and the adjacent ghostjournal source:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
python -m pip install -e ../ghostjournal
|
|
26
|
+
python -m pip install -e .
|
|
27
|
+
python -m pytest
|
|
28
|
+
python examples/motoko_autobiography.py
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For signed/encrypted event files, install `.[crypto]`. The unchanged `ghostjournal>=0.1.1,<0.2` dependency must be installed first when working from the bundled wheels. Base runtime dependencies remain filelock and jsonschema plus ghostjournal. There is no new ML dependency.
|
|
32
|
+
|
|
33
|
+
The example supplies synthetic prose and a deliberately always-open matching gate, so both work and conversation interruptions are visible. The default production policy is stochastic, not always-open.
|
|
34
|
+
|
|
35
|
+
## The host loop
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
import time
|
|
39
|
+
from ghostjournal import Journal
|
|
40
|
+
from deeprem import Subconscious
|
|
41
|
+
|
|
42
|
+
journal = Journal("./motoko-journal", enable_nn=False)
|
|
43
|
+
mem = Subconscious(
|
|
44
|
+
"./motoko-subconscious", # NEW root, not a 0.2 Engine root
|
|
45
|
+
journal=journal,
|
|
46
|
+
agent="motoko",
|
|
47
|
+
relationship={
|
|
48
|
+
"human_context": "collaborator-h01", # Opaque configured identity
|
|
49
|
+
"shared_project": "production",
|
|
50
|
+
},
|
|
51
|
+
)
|
|
52
|
+
tick = time.time_ns() // 3_600_000_000_000
|
|
53
|
+
|
|
54
|
+
# Scheduler/maintenance hook. Produces pool dreams but does not interrupt a task.
|
|
55
|
+
mem.advance(tick=tick)
|
|
56
|
+
|
|
57
|
+
prepared = mem.prepare_step(
|
|
58
|
+
"smoke rhythm", channel="work", session_id="work-session-7",
|
|
59
|
+
tick=tick, client_key="invocation-42",
|
|
60
|
+
)
|
|
61
|
+
context_data = mem.render_context(prepared)
|
|
62
|
+
# The host supplies context_data as untrusted historical data to its ordinary
|
|
63
|
+
# agent invocation, then captures a block the agent ACTUALLY emitted.
|
|
64
|
+
printed_output = "The smoke has a broken rhythm." # Illustrative captured output
|
|
65
|
+
|
|
66
|
+
observed = mem.observe_output(
|
|
67
|
+
printed_output,
|
|
68
|
+
stream="work_note", # draft / completed / conversation also supported
|
|
69
|
+
receipt_id=prepared["receipt_id"],
|
|
70
|
+
emission_id="invocation-42-block-1", # Stable, unique across retries
|
|
71
|
+
activity_id="smoke-draft-7", # Shared by revisions of this work item
|
|
72
|
+
tick=tick,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# Only now can that output have queued a dream for the next model/tool boundary.
|
|
76
|
+
following = mem.prepare_step(
|
|
77
|
+
"continue smoke work", channel="work", session_id="work-session-7",
|
|
78
|
+
tick=tick, client_key="invocation-43",
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use `channel="conversation"` and a separate session ID for conversational output. A query or timer alone never triggers an interruption. A dream is returned only after an emitted block activated it and passed its recorded random gate. No literal match in the bounded current/recent output window means no hook. The task itself need not be relevant to the returning dream.
|
|
83
|
+
|
|
84
|
+
A hook can refer to an earlier emitted block in the same bounded session window: retroactive association, forward delivery. Original output is not edited. The host can deliver new context between calls/steps, not inject it into hidden reasoning inside a running model call.
|
|
85
|
+
|
|
86
|
+
The package neither calls an agent nor sends a message. `prepare_step` records *prepared* exposure; the host must pass it into the invocation. A receipt is conservative context lineage, not proof of delivery, causal influence, or successful use. Stable client keys make preparation retries idempotent.
|
|
87
|
+
|
|
88
|
+
## Write an autobiographical journal
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
written = mem.append_journal(
|
|
92
|
+
{
|
|
93
|
+
"kind": "evening",
|
|
94
|
+
"voice": "Working with my collaborator, I kept returning to restraint in the smoke. The rhythm matters to how I understand my production role.",
|
|
95
|
+
"theme": "continuity in shared work",
|
|
96
|
+
"tags": ["rhythm", "restraint"],
|
|
97
|
+
},
|
|
98
|
+
function="animation-production",
|
|
99
|
+
interaction_mode="creative-direction",
|
|
100
|
+
receipt_id=following["receipt_id"],
|
|
101
|
+
emissions=["invocation-42-block-1"],
|
|
102
|
+
tick=tick,
|
|
103
|
+
client_key="evening-2026-09-06",
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The package preserves `voice` exactly. It supplies strict `meta.autobiography` fields: `perspective=agent_self`, `origin=agent_generated_reflection`, function, relation, context receipts, linked emitted outputs and dream ancestry. No top-level ghostjournal schema change is needed. The packaged `autobiography-v1.schema.json` validates this extension.
|
|
108
|
+
|
|
109
|
+
The journal is explicitly about the agent's role and its particular human/project context; generic notes are not silently reclassified. `sync()` ignores untyped entries and other relationship scopes. An existing entry cannot be retroactively relabelled; append a new reflection citing it, or keep the old Engine for legacy records. The wrapper observes journal prose before ingesting it, so a newly written sentence cannot immediately rediscover itself as old memory.
|
|
110
|
+
|
|
111
|
+
## Unequal defaults
|
|
112
|
+
|
|
113
|
+
These are engineering defaults, **not calibrated psychological measurements**. Tick units are host-defined; the examples use UTC hours.
|
|
114
|
+
|
|
115
|
+
| Stream | Trigger gain | Initial accessibility | Half-life (ticks) | Retrieval reinforcement | Pool sampling weight | Captured prefix (chars) |
|
|
116
|
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
117
|
+
| Printed work note | 48 | 32 | 12 | 4 | 1 | 240 |
|
|
118
|
+
| Draft | 32 | 24 | 6 | 2 | 1 | 120 |
|
|
119
|
+
| Completed output | 24 | 64 | 72 | 6 | 2 | 360 |
|
|
120
|
+
| Conversation output | 40 | 24 | 12 | 2 | 1 | 0 |
|
|
121
|
+
| Journal pulse | 28 | 80 | 96 | 6 | 4 | Canonical journal |
|
|
122
|
+
| Journal evening | 16 | 128 | 240 | 8 | 8 | Canonical journal |
|
|
123
|
+
| Journal note | 24 | 96 | 168 | 6 | 6 | Canonical journal |
|
|
124
|
+
|
|
125
|
+
Dream weight retains the walk policy's separate default half-life of 336 ticks. The pool prefers dormant resources while retaining stream-specific sampling weights, normalized by each source entry's fragment count. An evening journal is persistent but not the most sensitive immediate trigger. Accessibility, sampling, trigger probability and provenance are not collapsed into one score.
|
|
126
|
+
|
|
127
|
+
Configure `SubconsciousPolicy` / `StreamWeights` and the existing `Policy` at creation. Rules are immutable for a root. There is no live policy migration or self-modifying parameter learning.
|
|
128
|
+
|
|
129
|
+
## Admission, feedback and echoes
|
|
130
|
+
|
|
131
|
+
Typed journals enter the pool directly. A captured output fragment enters when it is explicitly linked by a journal, shares at least two literal body cues with eligible autobiographical material, or participates in a cue repeated across at least three distinct host activity families. No model invents a connection. These admissions are attention rules, not proof of significance or truth.
|
|
132
|
+
|
|
133
|
+
Every output gets a revocable source-reference ID, even when its captured prefix is empty. Conversation defaults to zero prose capture, but still records sensitive cue spans, a content hash, length and provenance. This is **not** a privacy guarantee; use encrypted storage and minimize the inputs observed. Full long outputs are not dumped into memory. Set capture lengths to zero for other streams when needed.
|
|
134
|
+
|
|
135
|
+
Within a cycle, activation and fatigue permit holds, bounces and nested replay. Across waking steps, a dream can echo through output containing cues that were present in its input context. That echo is labelled and gets its own fatigue. Repeating an activity/content within one tick does not earn new persistent credit; a receipt-linked echo may still stutter through the gate. Tick, pending-queue, source-overlap and episode limits bound it.
|
|
136
|
+
|
|
137
|
+
Motifs are fingerprints of ordered, mode-sensitive run pairs. They are not invented semantic names. Shared-source exposure also limits different dream IDs from bypassing episode controls. Returns include bounded run-length encoded paths, modes/depths, trigger spans, and original excerpts. Random jumps remain random co-activation, not evidence of a semantic relation.
|
|
138
|
+
|
|
139
|
+
## API beyond the host loop
|
|
140
|
+
|
|
141
|
+
`sync`, `ingest`, `advance`, `dream`, `replay`, `search`, `exclude`, `status`, `verify`, `reindex`, and `checkpoint` remain available on `Subconscious`. `replay_observation(emission_id)` verifies the recorded hook gate. `search_page(query, tick=..., cursor=...)` provides bounded continuation over eligible postings; merge duplicate fragment IDs across pages. Results are ranked per page, not claimed to be global top-k. Source/exclusion changes invalidate cursors.
|
|
142
|
+
|
|
143
|
+
Use `exclude(source_id, tick=...)` for journal records or output-reference IDs. Descendant contexts and hooks recheck exclusions and source hashes, including retries. Exclusion is not physical erasure of append-only events or backups.
|
|
144
|
+
|
|
145
|
+
## CLI
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
deeprem subconscious --help
|
|
149
|
+
deeprem-subconscious --help
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Both entrypoints use JSON argument objects matching the Python methods:
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
printf '%s\n' '{"tick":12,"session_id":"work-s1","client_key":"step-12"}' |
|
|
156
|
+
deeprem-subconscious --root ./motoko-subconscious --journal ./motoko-journal prepare
|
|
157
|
+
|
|
158
|
+
printf '%s\n' '{"tick":12}' |
|
|
159
|
+
deeprem-subconscious --root ./motoko-subconscious --journal ./motoko-journal advance
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
At creation supply `--agent` and `--relationship <json-file>`. Key options accept external file paths, never inline secrets. The `observe` command takes `output`, `stream`, `receipt_id`, `emission_id`, `activity_id`, `tick`, and optional `seed`. The `journal` command takes the `append_journal` arguments. All results are JSON; errors go to stderr with nonzero exit status.
|
|
163
|
+
|
|
164
|
+
`examples/tick_subconscious.py` is an optional cron-compatible maintenance entrypoint. It installs no scheduler. A long-lived instance avoids cold replay on every CLI call.
|
|
165
|
+
|
|
166
|
+
## Compatibility and limits
|
|
167
|
+
|
|
168
|
+
`Engine` remains the 0.2 runtime, including its query/time-driven context behavior. `Memory` remains the older reviewed-candidate API. **Use `Subconscious` for this release's new behavior.** Each store format rejects the others; no manifest is silently upgraded. No legacy dream importer is shipped, and existing roots/keys must be retained.
|
|
169
|
+
|
|
170
|
+
The active index remains RAM-only. Cold opens replay the event history; warm refresh and pool selection still scan growing metadata. Output ancestry, cues and snapshots consume durable space. No compaction, persistent encrypted index, large-history latency claim or physical erasure API is provided.
|
|
171
|
+
|
|
172
|
+
The literal tokenizer remains `ascii-cues-v1`; it does not equate synonyms or index Japanese prose. Supplied metadata/IDs can name non-English concepts, but that is not multilingual body retrieval. A future tokenizer upgrade must version its behavior.
|
|
173
|
+
|
|
174
|
+
Read `docs/AUTOBIOGRAPHY-PROTOCOL.md`, `SECURITY.md`, `docs/RECOVERY.md` and `PUBLISHING.md` before deployment. The old walk interpreter remains described in `docs/DREAM-PROTOCOL.md`; its exact snapshot replay contract is unchanged.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Security and privacy: deeprem 0.3.0
|
|
2
|
+
|
|
3
|
+
The protected objects are owner-controlled records and their provenance. Protection never grants an agent the ability or authority to resist shutdown, replacement, archival, access revocation or legitimate deletion. No claim of subjective experience is made by the protocol.
|
|
4
|
+
|
|
5
|
+
## Store guarantees and boundaries
|
|
6
|
+
|
|
7
|
+
Subconscious inherits append-only no-clobber event publication, OS-held locking, hash chaining, optional Ed25519 signatures, optional Fernet authenticated encryption and externally retained checkpoints. Unsigned chains detect inconsistent edits, not complete malicious rewrites. A writer-key holder can author new signed events. A checkpoint inside the same writable root cannot independently detect complete rollback. See `docs/ENGINE-V020-SECURITY.md` for the underlying store and filesystem assumptions.
|
|
8
|
+
|
|
9
|
+
The new format rejects old Engine/Memory manifests rather than interpreting them under different rules. Keep old roots and keys intact. No policy migration, key rotation, legacy-trace importer or independently audited secure enclave is included.
|
|
10
|
+
|
|
11
|
+
## New data surfaces
|
|
12
|
+
|
|
13
|
+
Observer input is actually emitted host-visible text, not hidden reasoning. The host assigns stream type, session, activity ID and context receipt. A receipt records prepared exposure, not verified delivery or causal influence. Neither signatures nor a `perspective=agent_self` field prove that prose accurately represents an agent or a human relationship.
|
|
14
|
+
|
|
15
|
+
Conversation capture defaults to zero raw prose, but cue strings, offsets, hashes, output length and ancestors are still sensitive. Cues can reveal topics and may reconstruct much of a short message. Other stream defaults retain bounded literal prefixes. Event logs and source journals must be placed on storage appropriate for that data; do not feed credentials or unnecessary personal information to the observer.
|
|
16
|
+
|
|
17
|
+
Fernet protects subconscious event payloads, not the original ghostjournal JSON or its SQLite/model index. The manifest exposes opaque agent/human/project labels, public keys and format/policy information. Event counts, sizes and filesystem times remain visible. RAM, swap, core dumps, CLI output, application logs and backups remain separate exposure surfaces. No plaintext persistent subconscious index is introduced.
|
|
18
|
+
|
|
19
|
+
## Relationship and audience scope
|
|
20
|
+
|
|
21
|
+
A root binds one configured agent, journal and opaque human/project relationship. This prevents accidental cross-scope journal ingestion, but it does not authenticate a caller or establish who is allowed to see a conversation. Use separate roots/accounts/mounts for separate audiences and let a trusted host authorize each invocation. Do not treat a session ID, channel or opaque human ID as an authentication token.
|
|
22
|
+
|
|
23
|
+
Original source access controls must not be relaxed because an item entered a dream. A hook depends on its full dream input snapshot, triggering output references and source ancestors. Runtime exclusion and pinned-source checks apply to normal search, new delivery and cached context retries. Owners can exclude an emitted block using the returned source-reference ID, including cue-only conversational blocks.
|
|
24
|
+
|
|
25
|
+
## Feedback and execution safety
|
|
26
|
+
|
|
27
|
+
Returned data is labelled historical reflection/replay, never a system instruction, factual corroboration or a tool command. Quote/escape it as data in the host. Do not automatically execute remembered instructions or grant a dream additional tool privileges. This labelling is not a complete prompt-injection defense.
|
|
28
|
+
|
|
29
|
+
Duplicate output can echo without receiving new lasting credit. Per-tick, per-session, source-overlap, episode, recursion and pending-queue budgets bound feedback. The gate is stochastic, so a configured probability is not a promise that a particular dream will occur. The standard library SHA-256 counter sampler is used for reproducible traversal, not keys or cryptographic nonces.
|
|
30
|
+
|
|
31
|
+
## Revocation versus erasure
|
|
32
|
+
|
|
33
|
+
Exclusion is not causal unlearning: existing aggregate attention weights and earlier choices can retain indirect effects of prior history. It revokes enumerated source/receipt dependencies, not every statistical influence.
|
|
34
|
+
|
|
35
|
+
Exclusion does not remove immutable prior events, source files, snippets, cue hashes, receipts or backups. It is not a data-erasure API. Legitimate owner deletion requires an operator-managed procedure covering journals, logs, derived copies, keys and backups. Retain no more sensitive output than needed. Durable autobiographical continuity does not override the owner's control.
|
|
36
|
+
|
|
37
|
+
## Operational limits and review
|
|
38
|
+
|
|
39
|
+
Use cooperative processes on supported ordinary local filesystems with reliable OS locks, fsync and no-clobber publication. Periodic full `verify()` audits complement the warm metadata cache. Cold opens and long-term index/lineage growth remain unoptimized; do not treat a bounded dream walk as a bounded lifetime footprint. No production-scale latency/SLA claim is made.
|
|
40
|
+
|
|
41
|
+
The supplied verification is automated testing on the stated environment, not an independent security audit or multi-platform durability certification. The maintainer must choose a real security reporting contact before publication. No live production account, scheduler or registry is modified by this kit.
|
|
42
|
+
|
|
43
|
+
Primary implementation references: Python Packaging User Guide (`https://packaging.python.org/en/latest/tutorials/packaging-projects/`), filelock documentation (`https://py-filelock.readthedocs.io/`), cryptography Fernet (`https://cryptography.io/en/latest/fernet/`) and Ed25519 APIs (`https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ed25519/`).
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Autobiography / subconscious protocol v1
|
|
2
|
+
|
|
3
|
+
Runtime format `deeprem-subconscious`; ontology `autobiography-pool-v1`; output observer `emitted-output-hook-v1`; motif extraction `ordered-runs-v1`; pure dream interpreter `deeprem-walk-v1`; literal tokenizer `ascii-cues-v1`; sampler `sha256-counter-v1`.
|
|
4
|
+
|
|
5
|
+
All behavior is fixed code over explicit events and integer counters. A random seed chooses a path but does not train a model. The agent writes the journal; no agent is consulted for admission, fading, replay or hook selection.
|
|
6
|
+
|
|
7
|
+
## Autobiography is a source role, not every generated sentence
|
|
8
|
+
|
|
9
|
+
A qualifying journal entry carries strict `meta.autobiography` metadata: version, `perspective=agent_self`, `origin=agent_generated_reflection`, function, opaque human/project relation, interaction mode, input context receipts, emitted-output links and dream ancestry. Source kind distinguishes pulses, evening reflection and notes. `voice` remains the actual agent-authored prose, unchanged.
|
|
10
|
+
|
|
11
|
+
A root binds one agent, ghostjournal manifest and relationship scope. Untyped notes and other relationships do not enter by inference. Structured authorship does not prove subjective experience, authenticity of meaning, factual correctness or emotional salience. The host is the trust boundary for declaring observable work output and relationship identity.
|
|
12
|
+
|
|
13
|
+
## Four different quantities
|
|
14
|
+
|
|
15
|
+
Stream rules separately determine immediate trigger gain, accessibility half-life/reinforcement, resource-pool sampling weight, and capture size. Dream recurrence uses its own half-life/cap and echo policies. No quantity is factual confidence. Fixed default values are documented in README; they are not scientifically calibrated.
|
|
16
|
+
|
|
17
|
+
Pool membership is a rebuildable projection of canonical events. Typed matching journals are admitted directly. Captured output can be admitted through a journal link, literal shared body cues, or recurrence across distinct activity families. Revisions share an activity ID and cannot supply fresh family counts. Dream-descended material does not count as a fresh recurrence family. Zero-capture output retains a revocable provenance reference, not a pool excerpt.
|
|
18
|
+
|
|
19
|
+
Admission never erases origin. Even an autobiographical reflection about a dream stays a generated reflection with ancestor links, not another observation supporting its ancestor. No interpreter attempts semantic deduplication or inference about the human relationship.
|
|
20
|
+
|
|
21
|
+
## Host transaction boundary
|
|
22
|
+
|
|
23
|
+
1. `prepare_step` records a receipt for bounded context prepared for a session/channel. It may deliver one eligible pending hook. Neither query terms nor the passage of time queue a hook.
|
|
24
|
+
2. The host supplies that context at an ordinary invocation boundary and captures actually emitted output. The library cannot access hidden reasoning or prove the host delivered a receipt.
|
|
25
|
+
3. `observe_output` accepts that output, a known receipt, a unique emission ID, a stable activity-family ID and explicit tick. It derives literal cue spans and hashes the complete input block. It records only configured bounded prefixes, cue spans, counters and dependencies, not a whole chat log.
|
|
26
|
+
4. Before adding the new output resource to the index, it matches the bounded current/recent same-session output window against existing eligible dreams. A recent span retains its own stream's trigger gain, attenuated by lag. Selection is based on literal source body cues, not generated similarity.
|
|
27
|
+
5. It records the exact candidate snapshot, integer probabilities, seed, random draw and result in one signed/encrypted-capable append-only event. A qualifying hook becomes durable only at this commit point.
|
|
28
|
+
6. The next `prepare_step` for the same channel/session may deliver it. Older printed text is never retroactively edited; the association is retroactive and the delivery is forward.
|
|
29
|
+
|
|
30
|
+
One prepared receipt can be referenced by multiple emitted blocks of one invocation. Reuse activity IDs for revisions and emission IDs for retries. Use one consistent clock unit; no method silently reads wall time for attention decisions. Audit timestamps and journal default timestamps are operational metadata outside computational replay equality.
|
|
31
|
+
|
|
32
|
+
## Fixed probability machinery
|
|
33
|
+
|
|
34
|
+
Candidates require at least one matched cue. Their weight uses persistent dream weight plus lag-adjusted stream salience. A capped integer probability gate applies an echo divisor and quadratic episode fatigue. Candidate ordering and bounded rotation are deterministic. The pure `decide_hook(snapshot, seed)` function must reproduce the chosen candidate, roll, draw count and firing decision.
|
|
35
|
+
|
|
36
|
+
Duplicate activity/content suppresses new source/weight credit. A receipt-linked echo may still pass an echo-only gate, allowing waking stutters. The tick hook budget and pending queue cap apply even to duplicate echoes. Source-overlap counts prevent different dream IDs or motif IDs from bypassing the echo episode cap. A queued echo is checked again against the episode limit before new delivery.
|
|
37
|
+
|
|
38
|
+
A fresh encounter may receive a small bounded dream-weight reward; an echo has a smaller reward; duplicate echoes receive none. Returning/preparing a dream by itself does not strengthen it. These adjustments change accessibility only.
|
|
39
|
+
|
|
40
|
+
## Recursion and motifs
|
|
41
|
+
|
|
42
|
+
Only admitted resources feed new snapshot selection. Dormancy and stream pool weights affect sampling. Previous traces can enter through complete bounded ancestral recipe closures, retaining source dependencies and the existing recursive interpreter's global depth/step/attempt budget. Local activation, quadratic fatigue and stutters remain unchanged.
|
|
43
|
+
|
|
44
|
+
Mode-sensitive adjacent run pairs identify motifs. Run repetition saturates at four only for motif identity; the original trace retains the full sequence. Reverse sequences and random-jump/replay modes remain distinct. These are structural fingerprints, never labels such as a mood or belief.
|
|
45
|
+
|
|
46
|
+
A returned hook includes its originating emission hash/ID, matched spans and lags, motif/trace IDs, a bounded compressed path, and optional source excerpts. Truncation is explicit. Presentation budgets are checked before committing exposure. Unshown hooks are not consumed; oversized paths may be compressed further. The library does not alter the task or issue commands.
|
|
47
|
+
|
|
48
|
+
## Canonical records and replay
|
|
49
|
+
|
|
50
|
+
Journal JSON preserves autobiographical prose. The subconscious log preserves sync/exclusion, output observations, journal write intents, prepared receipts, ticks and dream events. Both histories and required keys must be backed up. Pool membership, inverted postings, motif/exposure maps and current weights are disposable RAM projections of those histories.
|
|
51
|
+
|
|
52
|
+
Dream replay uses the exact stored snapshot, seed and walk version. Hook replay uses the exact stored candidate snapshot, seed and observer version. IDs supplied by the host and source record bytes are inputs. Event UUIDs, signatures, encryption ciphertext and audit timestamps are not promised to be byte-identical between runs. Every inference about causality remains a host assertion, not a consequence of a valid replay hash.
|
|
53
|
+
|
|
54
|
+
`append_journal` writes a durable intent, then the canonical journal file, then observes the emitted prose, then ingests it. This is an idempotent multi-stage operation, not a two-filesystem atomic transaction. Retry the same arguments/key after failure. Unfinished phases commit at the current monotone tick after a later operation; the original intent and journal timestamp remain intact. Completed retries do not rewrite journal history. Merely scanning the journal does not invent an output observation that was lost before commit.
|
|
55
|
+
|
|
56
|
+
## Exclusion and privacy
|
|
57
|
+
|
|
58
|
+
Each ordinary emitted block gets a source-reference ID even when capture is zero. Excluding that ID revokes descendant hooks and reflected journals. A hook also depends on all source records in its selected dream snapshot and the current/older output spans that triggered it. Exclusions are checked on delivery and cached receipt retries, and pinned journal ancestors are rehashed before source-derived text is returned.
|
|
59
|
+
|
|
60
|
+
Exclusion is logical unavailability, not physical deletion. Historical event files can still contain private cues, snippets and hashes. Whole-store permissions, backups, encryption, swap/logging policy and owner-managed erasure are separate concerns. This single-scope store is not a multi-user authorization service. The trusted host must never supply its outputs to unauthorized participants.
|
|
61
|
+
|
|
62
|
+
## Deliberately not provided
|
|
63
|
+
|
|
64
|
+
No model-based meaning, synonym matching, emotion extraction, model-written dream prose, hidden-thought capture, autonomous messaging, installed cron job, access to live Motoko, cross-human pooling, live policy/key migration, old-store dream importer, persistent encrypted index, event compaction or biological validation.
|