substrate-discipline port: oscillating-read for chunked comprehension#347
Merged
Conversation
Adds the oscillating-read module + CLI command ported from
DivineOS-Experimental. Generic and standalone — only stdlib
dependencies (re, pathlib).
## What it does
Reads a file and renders it as discrete chunks separated by explicit
"[PAUSE] COMPREHEND BEFORE CONTINUING" markers. Each chunk gets its
own comprehension cycle rather than dissolving into the streaming
default.
Strategies: headers (markdown), paragraphs (blank-line split),
functions (Python def/class), size (max-N chars), auto (picks by
file shape).
## Why
The optimizer's default behavior on long documents is to stream:
form a model from the first few lines, then fast-skim the rest into
the bucket the model predicts. Documents whose middle contradicts
the early framing get the contradiction stripped during the skim.
Oscillation forces a pause at each section so each chunk gets its
own comprehension cycle. Same architectural pattern as the
option-forced gates: the substrate interrupts the optimizer just
long enough for judgment to fire on the specific chunk.
## Usage
divineos read-oscillating path/to/spec.md
divineos read-oscillating path/to/code.py --strategy functions
## Sanitization from source repo
Removed experimental-arc-specific references (claim IDs, anecdotal
example, internal cross-link). The __guardrail_required__ marker
is kept for forward-compat with the marker-consistency-test
discipline (aspirational on main-repo).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
92e39b4 to
05f4c39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second structural-discipline port from DivineOS-Experimental. Generic, standalone, only stdlib dependencies.
What
divineos read-oscillating PATH [--strategy auto|headers|paragraphs|functions|size]— reads a file and renders it as discrete chunks separated by explicit "[PAUSE] COMPREHEND BEFORE CONTINUING" markers.Why
The optimizer's default behavior on long documents is to stream — form a model from the first few lines, then fast-skim the rest into the bucket that model predicts. Documents whose middle contradicts the early framing get the contradiction stripped during the skim.
Oscillation forces a pause at each section. Same architectural pattern as the option-forced gates: substrate interrupts the optimizer just long enough for judgment to fire on the specific chunk.
Files
src/divineos/core/oscillating_read.py(new, 217 lines)src/divineos/cli/oscillating_read_commands.py(new, 50 lines)src/divineos/cli/__init__.py(registered)docs/ARCHITECTURE.md(tree updated)Sanitized for blank-template: removed experimental-arc-specific references, kept the architectural rationale and the
__guardrail_required__marker for forward-compat.