Skip to main content

認知循環対話 — Cognitive Dialogue Runtime Foundation (Runtime Core).

Project description

Cognitive Runtime Core — 認知循環対話 Runtime Foundation

A replay-deterministic cognitive dialogue runtime. The conversation loop is a single tick() pipeline (dialogue/dialogue_loop.py) orchestrating ~30 cognitive stages (observatory capture → phase interpretation → memory coupling → distortion → language generation → residue/persistence), with every stage extracted to dialogue/tick_stages.py behind a per-tick TickState carrier.

Quick start

python main.py                 # interactive dialogue loop
python main.py --seed 42       # deterministic seed (reproducible run)
python main.py --debug         # per-tick cognitive-state snapshot
python main.py --legacy        # legacy DialogueManager pipeline (back-compat)

Runtime Core is pure standard library — no third-party runtime dependencies. Requires Python ≥ 3.11.

Install (optional)

pip install .                  # installs the Runtime Core packages + `cognitive-dialogue` entry point
pip install -e .[dev]          # editable + pytest for development

Packaging is additive: the source tree runs without installation (the test/replay harness uses the repository root on sys.path), so installing changes no behaviour.

Architecture — four import-separable layers

   Education (future)  ─┐  read-only until override-coordinator
   Extension           ─┤  audit_logs · observatory analyzers · dependency_mapper
        │ imports        │  (imports runtime_core.api; never imported by Core)
        ▼                │
   ┌─────────────────────▼─────────────────────┐
   │              RUNTIME CORE                   │  ◄── Research (research/)
   │  dialogue/ · core/ · memory/ ·             │      reaches Core only via
   │  runtime_core/{commitment,continuity_…} ·  │      degrade-to-False guards
   │  observatory/ (live) + cognitive subsystems│
   └────────────────────────────────────────────┘

Legal dependency direction: Education → Extension → Core ← Research. The boundary is an import-direction invariant enforced at every commit by tests/runtime/test_import_graph_boundary.py (7 tests), independent of file location.

  • Runtime Core runs standalone. research/ is a path directory (no __init__.py): a ship-core checkout omits it and the ~53 guarded research imports degrade to _AVAILABLE = False — a proven byte-identical degraded mode (main.py / conftest.py add research/ to sys.path only when present).
  • Public API: Extension and Education depend on runtime_core/api/ (a 29-name thin re-export), never on Core private symbols.

Replay contract (absolute invariant)

The runtime is byte-for-byte reproducible. Any change must preserve:

python audit_logs/tierc_replay_tuple.py --check    # tuple a31522d2… / output e3b1df88…
python audit_logs/tierc_baseline.py --replay       # ON  → e3b1df88
# (14 TIERC_*_DISABLE=1 then --replay)              # OFF → 43638b02

Gates

pytest tests dialogue/tests runtime_core            # core gate  → 2459 passed
pytest tests/ecology_observatory                    # observatory → 74 passed
pytest tests/runtime/test_import_graph_boundary.py  # boundary    → 7 passed

Repository layout

Path Role
dialogue/, core/, memory/, runtime_core/, observatory/ + cognitive subsystems Runtime Core
audit_logs/, dependency_mapper/, pacing/, calibration/ Runtime Extension (evaluators / observability)
research/ Research module (path-dir seam; detachable)
education/ Education module (greenfield scaffold; future phase)
governance/ Phase docs, RUNBOOK, packaging records, archived investigations
scripts/ Ad-hoc investigation/measurement scripts (not part of the runtime)
tests/ Test suite (pytest.ini testpaths = tests)
main.py Entry point

See governance/packaging/ for the packaging phase records and governance/thin_orchestrator/RUNBOOK.md for the de-monolith STOP-LINE contract.

Research archive

This project is research-grade: its design rationale, audits, and investigations are kept (not deleted) under governance/ so the runtime root stays minimal.

Path Contents
governance/research/ Conversation-pathology atlas, taxonomy, and review records
governance/archive/investigations/ Archived investigations, design notes, and audits (e.g. detachment, coherence, growth/forgetting evaluations)
governance/packaging/ Packaging phase records (0014) and equivalence reports
governance/handover/ Session handover docs and policy
governance/doctrine/, governance/current_status/ Standing doctrine and current-status snapshots

These are reference material for understanding why the runtime is shaped as it is; none of it is required to run or install Runtime Core.

License

Released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cognitive_runtime_core-1.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cognitive_runtime_core-1.0.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file cognitive_runtime_core-1.0.0.tar.gz.

File metadata

  • Download URL: cognitive_runtime_core-1.0.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for cognitive_runtime_core-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cc5778aea5966d686d5fdca27356df1b6ad8b99851409cfde0374de13a5009f5
MD5 5fafa5646edc684f3a01b6b280b74080
BLAKE2b-256 bc3153b60df785dd4c9d5161465cf5cd3439e11eaf5aca0f7692f943da62a730

See more details on using hashes here.

File details

Details for the file cognitive_runtime_core-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cognitive_runtime_core-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2f205719e5b96fe7390186cf4589c66bd3f19ded137695e66d2849d64dd291f
MD5 61844fc89b9893ced096abb4331d4667
BLAKE2b-256 40857764f784cca4c4cfd9bbea0a86e81a4aa0fb424a4d5c1d9edba1319a1ff7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page