Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github: HarperZ9
custom: ["https://harperz9.github.io", "https://harperz9.github.io/field-guide.html"]
github: [HarperZ9]
custom:
- https://harperz9.github.io
- https://harperz9.github.io/field-guide.html
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: behavior-transform.io CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install test dependencies
run: python -m pip install pytest

- name: Run tests
run: python -m pytest -q

- name: Verify flagship envelope
run: |
python -m unittest tests.test_behavior_flagship -v
python tools/behavior_flagship.py doctor --json
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# behavior-transform.io

![behavior-transform.io IO boundary calibration layer](assets/behavior-transform-hero.svg)

`behavior-transform.io` is the Project Telos private-line IO boundary
calibration layer. It provides local wrappers, hooks, and shell profiles for
read, write, exec, fetch, input, and model-boundary channels.

Its job is practical: make workstation IO explicit, mode-aware, and receipt
friendly without requiring hosts to ingest raw prompts, private file contents,
secret values, or full model-boundary payloads.

```bash
python tools/behavior_flagship.py status --json
python tools/behavior_flagship.py doctor --json
python tools/behavior_flagship.py demo --json
```

## Flagship Contract

| Surface | Status |
|---------|--------|
| CLI JSON | `tools/behavior_flagship.py status|doctor|demo --json` |
| Runtime profiles | `ops`, `research`, `academic` |
| Hook surface | Claude Code PreToolUse/PostToolUse hooks in `hooks/` |
| Shell surface | PowerShell, CMD, and sh profile helpers in `profiles/` |
| Interop schemas | `project-telos.flagship-action/v1`, `project-telos.action-receipt/v1`, `project-telos.context-envelope/v1` |
| Privacy boundary | Host receives counts, hashes, verdicts, and redacted refs; local adapters retain raw content |

## Modes

| Mode | Profile | Behavior |
|------|---------|----------|
| `ops` | standard | Calibration stack active |
| `research` | native | Source-faithful passthrough |
| `academic` | native | Research alias |

Switch mode:

```bash
python tools/io_state.py --set research
python tools/io_state.py --set ops
```

## Structure

```text
tools/ Core modules and CLI wrappers
hooks/ Claude Code hook adapters
profiles/ Shell integration helpers
tests/ Pytest and unittest coverage
docs/ Specs, plans, and integration contracts
```

## Verification

```bash
python -m pytest -q
python tools/behavior_flagship.py doctor --json
```

See [docs/INTEGRATION_CONTRACT.md](docs/INTEGRATION_CONTRACT.md) for the IO
boundary contract.
50 changes: 50 additions & 0 deletions assets/behavior-transform-hero.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions docs/INTEGRATION_CONTRACT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# behavior-transform.io Integration Contract

`behavior-transform.io` is the private-line IO boundary calibration layer for
Project Telos. It provides local wrappers, hooks, and shell profiles for moving
text through read, write, exec, fetch, input, and model-boundary channels with
explicit mode and provenance handling.

This repository is not an offensive tooling layer and does not own target
operations. It owns the workstation-local IO membrane around tools that do.

## Runtime Profiles

| Profile | Purpose | Transform behavior |
|---------|---------|--------------------|
| `ops` | Default operator mode | Calibration enabled |
| `research` | Source-faithful research mode | Passthrough |
| `academic` | Alias for research review | Passthrough |

Switching profile is local state only:

```powershell
python tools/io_state.py --set research
python tools/io_state.py --set ops
```

## Host Surfaces

- CLI JSON envelopes through `tools/behavior_flagship.py`
- Claude Code hooks in `hooks/`
- shell profiles in `profiles/`
- direct safe wrappers in `tools/safe_*.py`
- future MCP adapter surface using the same envelope schema

## Privacy Boundary

Hosts may receive:

- mode and profile names
- wrapper/tool names
- counts
- hashes
- verdicts
- redacted references

Hosts must not require raw prompts, private file contents, secret values,
credentials, hidden environment values, or full model-boundary payloads.

## Receipt Shape

Actions that cross write, exec, fetch, or model-boundary channels should record:

- `action_intent_id`
- `channel`
- `profile`
- `input_hash`
- `output_hash` or `redacted_output_ref`
- `decision_outcome`
- `verification_verdict`
- `evaluated_at`

The receipt must be sufficient to replay the boundary decision without exporting
private source content.
43 changes: 43 additions & 0 deletions tests/test_behavior_flagship.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import unittest

from tools.behavior_flagship import (
SCHEMA,
demo_envelope,
doctor_envelope,
status_envelope,
)


class BehaviorFlagshipTests(unittest.TestCase):
def test_status_uses_telos_schema(self) -> None:
envelope = status_envelope()

self.assertEqual(envelope["schema"], SCHEMA)
self.assertEqual(envelope["tool"], "behavior-transform.io")
self.assertEqual(envelope["status"], "MATCH")
self.assertIn("CLI JSON", envelope["native"]["host_surfaces"])
self.assertFalse(envelope["native"]["runtime_contract"]["raw_secret_export"])

def test_doctor_checks_contract_and_secret_boundary(self) -> None:
envelope = doctor_envelope()
checks = {
item["id"]
for output in envelope["outputs"]
if output["kind"] == "checks"
for item in output["items"]
}

self.assertIn("required:docs/INTEGRATION_CONTRACT.md", checks)
self.assertIn("raw-secret-boundary", checks)
self.assertEqual(envelope["status"], "MATCH")

def test_demo_is_local_io_only(self) -> None:
envelope = demo_envelope()
demo = envelope["outputs"][0]

self.assertEqual(demo["runtime_surface"], "local_io")
self.assertIn("switch back to ops calibration", demo["steps"])


if __name__ == "__main__":
unittest.main()
Loading