Skip to main content

A cognitive operating layer for AI models: bounded loops, observable-defect inspection, targeted repair, and layered verification.

Project description

PIÉNSALO

Give any AI a better way to think.

The open artificial cortex for AI.

PIÉNSALO is a model-independent cognitive operating system that helps AI models and agents understand the real objective, structure difficult work, inspect their output, repair specific failures, verify the result, know when not to intervene, preserve evidence, and continue across sessions.

Created by Rafael “Ralph” Peña. Piénsalo — "think it through." Pronounced: pee-EN-sa-lo.

Status: public alpha. The runtime, portable skills, packaging, evaluation harness, and core verification workflows are tested. Current live experimental evidence is primarily from the Claude model family; cross-model validation, independent reproduction, and real-world case studies are expanding in public.

The wedge, in one sentence: give PIÉNSALO a task and an AI's draft — it finds what was actually missed, leaves correct work alone, emits the smallest justified repair when one is warranted, verifies what can honestly be verified, and says NO REPAIR NEEDED when intervention would only cause harm.

60 seconds, for real

Every line below is real output from the shipped CLI — the transcript is committed at examples/flagship/TRANSCRIPT.md and a CI test re-runs the demo and fails if this ever drifts.

A quote task applies two sequential discounts (20%, then 15%). The AI draft added them (35% off → $221.00) instead of compounding (→ $231.20):

$ piensalo inspect --task examples/flagship/task.md \
    --draft examples/flagship/draft-broken.md \
    --contract examples/flagship/contract.json
selected repair(s): rederive-the-numbers
  evidence: asserts a figure with no visible derivation on a multi-rate task

$ piensalo verify --task examples/flagship/task.md \
    --draft examples/flagship/draft-broken.md \
    --contract examples/flagship/contract.json
FAILED
  QUOTE_USD: 221.00 != expected 231.20
[exit: 1]

piensalo repair then emits a repair packet — the complete, ready-to-run prompt for your model, honestly labeled: "instructions for a model; nothing has been applied." (With --adapter, it runs the packet through a model you explicitly choose, writes the repaired draft to a new file with a provenance sidecar, and re-inspects the result — it never claims success just because a model returned text.)

And on a draft that is already right:

$ piensalo inspect --task examples/flagship/task.md \
    --draft examples/flagship/draft-correct.md \
    --contract examples/flagship/contract.json
NO REPAIR NEEDED — no observable defect cleared the activation threshold.

$ piensalo verify --task examples/flagship/task.md \
    --draft examples/flagship/draft-correct.md \
    --contract examples/flagship/contract.json
DETERMINISTICALLY VERIFIED
  QUOTE_USD: 231.20 == expected
CONTRACT VERIFIED
UNMEASURED
  cognition: UNMEASURED (no verifier configured — this is not a pass)

Run the whole thing yourself: bash examples/flagship/demo.sh

Install

# From PyPI
uvx piensalo doctor
pipx install piensalo

# Directly from GitHub
uvx --from git+https://github.com/ralfyishere/piensalo piensalo doctor

# From a clone (development)
git clone https://github.com/ralfyishere/piensalo.git && cd piensalo
uv sync && uv run piensalo doctor

# Portable Agent Skills only (no runtime needed)
npx skills add ralfyishere/piensalo

doctor verifies your environment and confirms the core runs fully offline — no telemetry, no network, nothing leaves your machine. Python ≥ 3.10; tested in CI on Linux and macOS, Python 3.10–3.13 (Windows unsupported for now).

How the workflow behaves

TASK → DRAFT → INSPECT → ABSTAIN or TARGETED REPAIR → VERIFY → FINAL ARTIFACT
  • inspect detects observable defects with evidence lines — never vibes.
  • repair has two honest modes: offline (emit the packet) or adapter-backed (--adapter claude-cli|openai|ollama|manual, --model, --output) — original draft preserved, provenance recorded, result re-inspected.
  • verify reports in five strict buckets — DETERMINISTICALLY VERIFIED, CONTRACT VERIFIED, MODEL-ASSISTED CHECK, UNMEASURED, FAILED — and UNMEASURED never counts as a pass.
  • think compiles a task (file or inline text) into a bounded cognitive program; loop keeps long-running work resumable with model provenance; skill manages the portable skill packages.
  • Silent model fallback is prohibited by design: adapters record requested and resolved model and stop on mismatch.

Use less context. Lose none of the intelligence.

piensalo context turns long transcripts and chatter-heavy project context into the smallest task-specific packet that preserves decisions (with supersession), constraints, failed approaches, exact identifiers, and stop conditions — then verifies the model's response deterministically and expands or falls back when verification fails.

# offline + deterministic: capsule / packet construction
piensalo context compile transcript.txt --goal "continue" --budget 3000 --output out/
piensalo context optimize --task task.md --context session.jsonl --budget 4000 --output opt/

# explicit-adapter execution with verification, bounded expansion, safe fallback
piensalo context run --task task.md --context session.jsonl --budget 4000 \
  --adapter claude-cli --model <model> --contract contract.json --output run/

# paired full-vs-optimized evidence run (benchmark cost ledgered separately)
piensalo context evaluate --task task.md --context session.jsonl \
  --adapter claude-cli --model <model> --budgets 2000,4000 --output eval/

Measured, not promised — on the pre-registered 8-task suite (evals/context-optimizer/, graders frozen before any run, claude-haiku-4-5-20251001, single samples): median gross context reduction 80.2%, median runtime net input savings 76.9%, 7/7 optimizable tasks MAINTAINED every deterministic requirement with zero regressions, and the designed uncompressible task refused optimization and fell back safely. A committed demo run (examples/context-optimizer/) passes all seven requirements from a packet 66% smaller than the full prompt (MAINTAINED, single sample). Scope honestly: one model family, deterministic graders, chatter-heavy contexts — broader behavioral equivalence is UNMEASURED, and a task that needs full context gets full context.

Why trust it

Every capability ships with receipts. Two pre-registered 120-cell controlled runs sit behind the defaults — including the finding that forced repair on already-correct drafts damages delivery ~29% of the time while never corrupting cognition. That is why abstention is the default posture.

  • EVIDENCE.md — mechanism records with maturity levels (DESIGNED → … → PROMOTED, with NARROW and REJECTED as honest terminal states; nothing is PROMOTED yet)
  • BENCHMARKS.md — run designs and numbers, confounds attached
  • NEGATIVE-RESULTS.md — the eight failures we keep public on purpose
  • Reproduce: make benchmark (no API key needed) · full harness in evals/
  • Current limits, honestly: one model family live-tested (Claude); n = 8 tasks per run; OpenAI-compatible/Ollama adapters are unit-tested with live validation pending; no independent reproduction yet. Help change that: docs/alpha/SUBMIT-RESULTS.md.

Going deeper

  • 27 portable skill packages: skills/ (8 domain) + micro-skills/ (19 focused repairs) — each with triggers, counterindications, an evidence level, and a near-miss example; installable into any agent that speaks Agent Skills.
  • The cognitive core (11 operations, human- and machine-readable): src/piensalo/core/
  • Architecture, methodology, evidence levels: docs/ · export provenance and hash manifest: docs/provenance/

Security

Offline by default; no telemetry; no shell execution from untrusted skill text; skill packages scannable with piensalo skill scan. Threat model: docs/THREAT-MODEL.md. Sensitive reports: GitHub Private Vulnerability Reporting (SECURITY.md).

Contributing

Real-task results are the most valuable contribution — all five outcomes, including "it correctly did nothing" and "it invented a problem": docs/alpha/SUBMIT-RESULTS.md. Code, skills, verifiers, adapters: CONTRIBUTING.md — every contribution meets the same evidence and security bar. Principles: MANIFESTO.md.

Creator

PIÉNSALO was created by Rafael “Ralph” Peña.

It began as an attempt to preserve and transfer powerful AI problem-solving behavior. The experiments showed that larger prompts alone were not enough: some interventions helped, while others overloaded weaker models, damaged correct delivery, routed incorrectly, or created false confidence.

PIÉNSALO was built from the mechanisms that survived the evidence — the full story is in docs/origin-story.md.

Think through hard work. Verify what matters. Know when to stop.

Piénsalo is an independent open-source project. It is not affiliated with or endorsed by Anthropic.

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

piensalo-0.1.0a4.tar.gz (505.3 kB view details)

Uploaded Source

Built Distribution

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

piensalo-0.1.0a4-py3-none-any.whl (123.4 kB view details)

Uploaded Python 3

File details

Details for the file piensalo-0.1.0a4.tar.gz.

File metadata

  • Download URL: piensalo-0.1.0a4.tar.gz
  • Upload date:
  • Size: 505.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piensalo-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 aa35b25ad10c05366c4bb349deaf1fe3bed85097e9c505cf90acfe6e00225046
MD5 b2647c1942fe0fde196d114ce0603995
BLAKE2b-256 7dac8914b047feb3f3a8304622e420c0c0cf5843ce2dc80863298f2d5196fac4

See more details on using hashes here.

Provenance

The following attestation bundles were made for piensalo-0.1.0a4.tar.gz:

Publisher: publish.yml on ralfyishere/piensalo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piensalo-0.1.0a4-py3-none-any.whl.

File metadata

  • Download URL: piensalo-0.1.0a4-py3-none-any.whl
  • Upload date:
  • Size: 123.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piensalo-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 dd492a4fdfc22b9acd3451a2dc198a8a55334327dbf1f68ab72aa4045faa925d
MD5 c77cc445d9816c6d50794430cff263b9
BLAKE2b-256 e14c8b3f850b50e5f1da484f2aa5f07d90c70dc52c7574bf786a60cbe0732d22

See more details on using hashes here.

Provenance

The following attestation bundles were made for piensalo-0.1.0a4-py3-none-any.whl:

Publisher: publish.yml on ralfyishere/piensalo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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