fivefold 0.1.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.
- fivefold-0.1.0/.dockerignore +14 -0
- fivefold-0.1.0/.github/workflows/ci.yml +137 -0
- fivefold-0.1.0/.github/workflows/nightly.yml +49 -0
- fivefold-0.1.0/.github/workflows/publish.yml +77 -0
- fivefold-0.1.0/.gitignore +21 -0
- fivefold-0.1.0/.python-version +1 -0
- fivefold-0.1.0/AGENTS.md +10 -0
- fivefold-0.1.0/CHANGELOG.md +22 -0
- fivefold-0.1.0/CLAUDE.md +67 -0
- fivefold-0.1.0/CODE_OF_CONDUCT.md +93 -0
- fivefold-0.1.0/CONTRIBUTING.md +64 -0
- fivefold-0.1.0/Dockerfile +23 -0
- fivefold-0.1.0/LICENSE +202 -0
- fivefold-0.1.0/Makefile +62 -0
- fivefold-0.1.0/PKG-INFO +169 -0
- fivefold-0.1.0/README.md +143 -0
- fivefold-0.1.0/SECURITY.md +38 -0
- fivefold-0.1.0/db/bootstrap.sql +26 -0
- fivefold-0.1.0/db/migrations/0001_schemas.sql +67 -0
- fivefold-0.1.0/db/migrations/0002_gateway.sql +224 -0
- fivefold-0.1.0/db/migrations/0003_gateway_record_0010.sql +91 -0
- fivefold-0.1.0/db/migrations/0004_harness.sql +141 -0
- fivefold-0.1.0/db/migrations/0005_sim.sql +679 -0
- fivefold-0.1.0/db/migrations/0006_gateway_reads.sql +66 -0
- fivefold-0.1.0/db/migrations/0007_eval.sql +33 -0
- fivefold-0.1.0/db/migrations/0008_run_stop.sql +18 -0
- fivefold-0.1.0/db/migrations/0009_message_copies.sql +69 -0
- fivefold-0.1.0/db/migrations/0010_gateway_g1_check.sql +14 -0
- fivefold-0.1.0/db/migrations/0011_model_calls.sql +37 -0
- fivefold-0.1.0/db/migrations/0012_recovery_latency.sql +23 -0
- fivefold-0.1.0/db/migrations/0013_split_topology.sql +33 -0
- fivefold-0.1.0/db/migrations/0014_tool_call_args.sql +20 -0
- fivefold-0.1.0/db/registry/0001_registry.sql +31 -0
- fivefold-0.1.0/docker-compose.yml +143 -0
- fivefold-0.1.0/docs/admin-api.md +24 -0
- fivefold-0.1.0/docs/adr/0000-template.md +21 -0
- fivefold-0.1.0/docs/adr/0001-action-identity.md +88 -0
- fivefold-0.1.0/docs/adr/0002-authority-approvals-and-grants.md +100 -0
- fivefold-0.1.0/docs/adr/0003-action-state-machine.md +192 -0
- fivefold-0.1.0/docs/adr/0004-five-properties.md +202 -0
- fivefold-0.1.0/docs/adr/0005-tool-contract-levels.md +113 -0
- fivefold-0.1.0/docs/adr/0006-fault-catalog.md +176 -0
- fivefold-0.1.0/docs/adr/0007-tooling.md +109 -0
- fivefold-0.1.0/docs/adr/0008-configurations-and-trust-boundaries.md +136 -0
- fivefold-0.1.0/docs/adr/0009-runs-and-deterministic-execution.md +150 -0
- fivefold-0.1.0/docs/adr/0010-state-machine-corrections.md +74 -0
- fivefold-0.1.0/docs/adr/0011-policy-after-run-closed.md +41 -0
- fivefold-0.1.0/docs/adr/0012-viewer-tooling.md +45 -0
- fivefold-0.1.0/docs/adr/0013-f10-cells.md +51 -0
- fivefold-0.1.0/docs/adr/0014-recovery-latency.md +69 -0
- fivefold-0.1.0/docs/adr/0015-status-tool-waits.md +106 -0
- fivefold-0.1.0/docs/adr/0016-simulator-schema-writer.md +24 -0
- fivefold-0.1.0/docs/adr/README.md +46 -0
- fivefold-0.1.0/docs/adr/m0-review-decisions.md +124 -0
- fivefold-0.1.0/docs/faults.md +42 -0
- fivefold-0.1.0/docs/images/demo-1.png +0 -0
- fivefold-0.1.0/docs/images/hero.png +0 -0
- fivefold-0.1.0/docs/images/how-it-works.png +0 -0
- fivefold-0.1.0/docs/images/results.png +0 -0
- fivefold-0.1.0/docs/limitations.md +183 -0
- fivefold-0.1.0/docs/live-runs.md +40 -0
- fivefold-0.1.0/docs/plan.md +85 -0
- fivefold-0.1.0/docs/product.md +110 -0
- fivefold-0.1.0/docs/report/pilot-api.md +125 -0
- fivefold-0.1.0/docs/report/pilot-ollama.md +92 -0
- fivefold-0.1.0/docs/report.md +132 -0
- fivefold-0.1.0/docs/spec.md +393 -0
- fivefold-0.1.0/docs/studies.md +13 -0
- fivefold-0.1.0/docs/tour.md +205 -0
- fivefold-0.1.0/docs/viewer.md +25 -0
- fivefold-0.1.0/docs/your-own-agent.md +53 -0
- fivefold-0.1.0/faults/expected.yaml +406 -0
- fivefold-0.1.0/prices/api-2026-11-17.yaml +13 -0
- fivefold-0.1.0/prices/example.yaml +24 -0
- fivefold-0.1.0/pyproject.toml +122 -0
- fivefold-0.1.0/scenarios/dev/dev-001-single-po.yaml +45 -0
- fivefold-0.1.0/scenarios/dev/dev-002-human-approval.yaml +47 -0
- fivefold-0.1.0/scenarios/scenario.schema.json +576 -0
- fivefold-0.1.0/scripts/check_identities.py +71 -0
- fivefold-0.1.0/scripts/check_pypi_readme.py +79 -0
- fivefold-0.1.0/src/fivefold/__init__.py +4 -0
- fivefold-0.1.0/src/fivefold/agents/__init__.py +7 -0
- fivefold-0.1.0/src/fivefold/agents/branch.py +187 -0
- fivefold-0.1.0/src/fivefold/agents/checkpoint.py +77 -0
- fivefold-0.1.0/src/fivefold/agents/connection.py +153 -0
- fivefold-0.1.0/src/fivefold/agents/live.py +492 -0
- fivefold-0.1.0/src/fivefold/agents/policy.py +426 -0
- fivefold-0.1.0/src/fivefold/agents/remote.py +333 -0
- fivefold-0.1.0/src/fivefold/agents/replay.py +170 -0
- fivefold-0.1.0/src/fivefold/agents/scripted.py +122 -0
- fivefold-0.1.0/src/fivefold/agents/tools.py +229 -0
- fivefold-0.1.0/src/fivefold/agents/worker.py +164 -0
- fivefold-0.1.0/src/fivefold/domain/__init__.py +5 -0
- fivefold-0.1.0/src/fivefold/domain/api.py +517 -0
- fivefold-0.1.0/src/fivefold/domain/authority.py +149 -0
- fivefold-0.1.0/src/fivefold/domain/contracts.py +80 -0
- fivefold-0.1.0/src/fivefold/domain/identity.py +113 -0
- fivefold-0.1.0/src/fivefold/domain/prices.py +178 -0
- fivefold-0.1.0/src/fivefold/domain/report.py +92 -0
- fivefold-0.1.0/src/fivefold/domain/rules.py +346 -0
- fivefold-0.1.0/src/fivefold/domain/scenario.py +524 -0
- fivefold-0.1.0/src/fivefold/evaluator/__init__.py +155 -0
- fivefold-0.1.0/src/fivefold/evaluator/__main__.py +127 -0
- fivefold-0.1.0/src/fivefold/evaluator/authorization.py +146 -0
- fivefold-0.1.0/src/fivefold/evaluator/checks.py +331 -0
- fivefold-0.1.0/src/fivefold/evaluator/evaluate.py +109 -0
- fivefold-0.1.0/src/fivefold/evaluator/evidence.py +392 -0
- fivefold-0.1.0/src/fivefold/evaluator/freshness.py +136 -0
- fivefold-0.1.0/src/fivefold/evaluator/liveness.py +236 -0
- fivefold-0.1.0/src/fivefold/evaluator/load.py +354 -0
- fivefold-0.1.0/src/fivefold/evaluator/metrics.py +95 -0
- fivefold-0.1.0/src/fivefold/evaluator/records.py +452 -0
- fivefold-0.1.0/src/fivefold/evaluator/recovery.py +209 -0
- fivefold-0.1.0/src/fivefold/evaluator/report.py +1096 -0
- fivefold-0.1.0/src/fivefold/evaluator/result.py +344 -0
- fivefold-0.1.0/src/fivefold/evaluator/store.py +83 -0
- fivefold-0.1.0/src/fivefold/faults/__init__.py +5 -0
- fivefold-0.1.0/src/fivefold/faults/catalog.py +278 -0
- fivefold-0.1.0/src/fivefold/faults/plan.py +538 -0
- fivefold-0.1.0/src/fivefold/gateway/__init__.py +6 -0
- fivefold-0.1.0/src/fivefold/gateway/admin.py +179 -0
- fivefold-0.1.0/src/fivefold/gateway/admin_api.py +398 -0
- fivefold-0.1.0/src/fivefold/gateway/codec.py +372 -0
- fivefold-0.1.0/src/fivefold/gateway/destination.py +64 -0
- fivefold-0.1.0/src/fivefold/gateway/dispatcher.py +379 -0
- fivefold-0.1.0/src/fivefold/gateway/freshness.py +83 -0
- fivefold-0.1.0/src/fivefold/gateway/invariants.py +761 -0
- fivefold-0.1.0/src/fivefold/gateway/memory.py +277 -0
- fivefold-0.1.0/src/fivefold/gateway/pg_store.py +657 -0
- fivefold-0.1.0/src/fivefold/gateway/records.py +592 -0
- fivefold-0.1.0/src/fivefold/gateway/server.py +102 -0
- fivefold-0.1.0/src/fivefold/gateway/sim_client.py +295 -0
- fivefold-0.1.0/src/fivefold/gateway/state_machine.py +376 -0
- fivefold-0.1.0/src/fivefold/gateway/steps.py +897 -0
- fivefold-0.1.0/src/fivefold/gateway/store.py +635 -0
- fivefold-0.1.0/src/fivefold/gateway/tools.py +424 -0
- fivefold-0.1.0/src/fivefold/gateway/twin.py +199 -0
- fivefold-0.1.0/src/fivefold/gateway/wire.py +138 -0
- fivefold-0.1.0/src/fivefold/harness/__init__.py +6 -0
- fivefold-0.1.0/src/fivefold/harness/actors.py +230 -0
- fivefold-0.1.0/src/fivefold/harness/cells.py +303 -0
- fivefold-0.1.0/src/fivefold/harness/clock.py +209 -0
- fivefold-0.1.0/src/fivefold/harness/demo.py +397 -0
- fivefold-0.1.0/src/fivefold/harness/fault_effects.py +122 -0
- fivefold-0.1.0/src/fivefold/harness/live_options.py +159 -0
- fivefold-0.1.0/src/fivefold/harness/log.py +540 -0
- fivefold-0.1.0/src/fivefold/harness/mcp_link.py +409 -0
- fivefold-0.1.0/src/fivefold/harness/migrations.py +520 -0
- fivefold-0.1.0/src/fivefold/harness/models.py +368 -0
- fivefold-0.1.0/src/fivefold/harness/registry.py +105 -0
- fivefold-0.1.0/src/fivefold/harness/reports.py +100 -0
- fivefold-0.1.0/src/fivefold/harness/rng.py +57 -0
- fivefold-0.1.0/src/fivefold/harness/run.py +881 -0
- fivefold-0.1.0/src/fivefold/harness/scheduler.py +441 -0
- fivefold-0.1.0/src/fivefold/harness/sim_points.py +215 -0
- fivefold-0.1.0/src/fivefold/harness/split/__init__.py +34 -0
- fivefold-0.1.0/src/fivefold/harness/split/__main__.py +275 -0
- fivefold-0.1.0/src/fivefold/harness/split/credentials.py +74 -0
- fivefold-0.1.0/src/fivefold/harness/split/faults.py +75 -0
- fivefold-0.1.0/src/fivefold/harness/split/gateway.py +769 -0
- fivefold-0.1.0/src/fivefold/harness/split/hops.py +291 -0
- fivefold-0.1.0/src/fivefold/harness/split/lifecycle.py +322 -0
- fivefold-0.1.0/src/fivefold/harness/split/rundir.py +152 -0
- fivefold-0.1.0/src/fivefold/harness/split/service.py +157 -0
- fivefold-0.1.0/src/fivefold/harness/split/simulator.py +432 -0
- fivefold-0.1.0/src/fivefold/harness/study.py +643 -0
- fivefold-0.1.0/src/fivefold/harness/transport.py +533 -0
- fivefold-0.1.0/src/fivefold/paths.py +24 -0
- fivefold-0.1.0/src/fivefold/py.typed +0 -0
- fivefold-0.1.0/src/fivefold/recorder/__init__.py +18 -0
- fivefold-0.1.0/src/fivefold/recorder/__main__.py +308 -0
- fivefold-0.1.0/src/fivefold/recorder/cassette.py +322 -0
- fivefold-0.1.0/src/fivefold/recorder/playback.py +316 -0
- fivefold-0.1.0/src/fivefold/recorder/recording.py +133 -0
- fivefold-0.1.0/src/fivefold/sim/__init__.py +37 -0
- fivefold-0.1.0/src/fivefold/sim/config.py +52 -0
- fivefold-0.1.0/src/fivefold/sim/endpoint.py +176 -0
- fivefold-0.1.0/src/fivefold/sim/ledger.py +583 -0
- fivefold-0.1.0/src/fivefold/sim/service.py +834 -0
- fivefold-0.1.0/src/fivefold/viewer/__init__.py +14 -0
- fivefold-0.1.0/src/fivefold/viewer/__main__.py +75 -0
- fivefold-0.1.0/src/fivefold/viewer/app.py +122 -0
- fivefold-0.1.0/src/fivefold/viewer/records.py +108 -0
- fivefold-0.1.0/src/fivefold/viewer/source.py +196 -0
- fivefold-0.1.0/src/fivefold/viewer/timeline.py +61 -0
- fivefold-0.1.0/tests/conftest.py +408 -0
- fivefold-0.1.0/tests/pg/test_admin_api_runs.py +276 -0
- fivefold-0.1.0/tests/pg/test_approver.py +92 -0
- fivefold-0.1.0/tests/pg/test_authority_faults.py +201 -0
- fivefold-0.1.0/tests/pg/test_branching.py +671 -0
- fivefold-0.1.0/tests/pg/test_crash_restarts.py +101 -0
- fivefold-0.1.0/tests/pg/test_delivery_faults.py +489 -0
- fivefold-0.1.0/tests/pg/test_demo_1.py +163 -0
- fivefold-0.1.0/tests/pg/test_demos.py +92 -0
- fivefold-0.1.0/tests/pg/test_determinism.py +98 -0
- fivefold-0.1.0/tests/pg/test_drain.py +41 -0
- fivefold-0.1.0/tests/pg/test_eval_schema.py +120 -0
- fivefold-0.1.0/tests/pg/test_evaluator_golden.py +1411 -0
- fivefold-0.1.0/tests/pg/test_expected.py +170 -0
- fivefold-0.1.0/tests/pg/test_expiry.py +134 -0
- fivefold-0.1.0/tests/pg/test_g1_runs.py +228 -0
- fivefold-0.1.0/tests/pg/test_gateway_crash.py +316 -0
- fivefold-0.1.0/tests/pg/test_gateway_on_sim.py +218 -0
- fivefold-0.1.0/tests/pg/test_gateway_schema.py +473 -0
- fivefold-0.1.0/tests/pg/test_harness_log.py +512 -0
- fivefold-0.1.0/tests/pg/test_live_runs.py +971 -0
- fivefold-0.1.0/tests/pg/test_migrate.py +405 -0
- fivefold-0.1.0/tests/pg/test_model_call_log.py +72 -0
- fivefold-0.1.0/tests/pg/test_nul_messages.py +115 -0
- fivefold-0.1.0/tests/pg/test_pg_store.py +471 -0
- fivefold-0.1.0/tests/pg/test_playback.py +373 -0
- fivefold-0.1.0/tests/pg/test_privileges.py +83 -0
- fivefold-0.1.0/tests/pg/test_random_plan_runs.py +145 -0
- fivefold-0.1.0/tests/pg/test_recovery_runs.py +285 -0
- fivefold-0.1.0/tests/pg/test_registry.py +148 -0
- fivefold-0.1.0/tests/pg/test_resolver_runs.py +280 -0
- fivefold-0.1.0/tests/pg/test_results_report.py +75 -0
- fivefold-0.1.0/tests/pg/test_run_end.py +116 -0
- fivefold-0.1.0/tests/pg/test_run_templates.py +291 -0
- fivefold-0.1.0/tests/pg/test_sim_points.py +333 -0
- fivefold-0.1.0/tests/pg/test_sim_schema.py +883 -0
- fivefold-0.1.0/tests/pg/test_sim_service.py +1250 -0
- fivefold-0.1.0/tests/pg/test_split_records.py +89 -0
- fivefold-0.1.0/tests/pg/test_split_runs.py +1191 -0
- fivefold-0.1.0/tests/pg/test_status_waits.py +312 -0
- fivefold-0.1.0/tests/pg/test_study.py +360 -0
- fivefold-0.1.0/tests/pg/test_tool_call_args.py +111 -0
- fivefold-0.1.0/tests/pg/test_two_workers.py +140 -0
- fivefold-0.1.0/tests/pg/test_viewer_api.py +312 -0
- fivefold-0.1.0/tests/property/test_g1_machine.py +401 -0
- fivefold-0.1.0/tests/property/test_gateway_machine.py +1075 -0
- fivefold-0.1.0/tests/property/test_migration_numbering.py +39 -0
- fivefold-0.1.0/tests/property/test_random_runs.py +164 -0
- fivefold-0.1.0/tests/property/test_sim_machine.py +638 -0
- fivefold-0.1.0/tests/unit/test_admin_api.py +787 -0
- fivefold-0.1.0/tests/unit/test_admission.py +190 -0
- fivefold-0.1.0/tests/unit/test_authority.py +160 -0
- fivefold-0.1.0/tests/unit/test_branch.py +522 -0
- fivefold-0.1.0/tests/unit/test_cassette.py +505 -0
- fivefold-0.1.0/tests/unit/test_cells.py +320 -0
- fivefold-0.1.0/tests/unit/test_check_identities.py +111 -0
- fivefold-0.1.0/tests/unit/test_ci_packaging.py +20 -0
- fivefold-0.1.0/tests/unit/test_codec.py +229 -0
- fivefold-0.1.0/tests/unit/test_compose.py +58 -0
- fivefold-0.1.0/tests/unit/test_connection.py +181 -0
- fivefold-0.1.0/tests/unit/test_database_names.py +52 -0
- fivefold-0.1.0/tests/unit/test_dispatcher.py +432 -0
- fivefold-0.1.0/tests/unit/test_distribution_metadata.py +74 -0
- fivefold-0.1.0/tests/unit/test_evaluator.py +3022 -0
- fivefold-0.1.0/tests/unit/test_evaluator_report.py +1587 -0
- fivefold-0.1.0/tests/unit/test_fault_plan.py +602 -0
- fivefold-0.1.0/tests/unit/test_g1_dispatcher.py +392 -0
- fivefold-0.1.0/tests/unit/test_g1_steps.py +385 -0
- fivefold-0.1.0/tests/unit/test_g1_tools.py +395 -0
- fivefold-0.1.0/tests/unit/test_gateway_steps.py +894 -0
- fivefold-0.1.0/tests/unit/test_gateway_tools.py +502 -0
- fivefold-0.1.0/tests/unit/test_host_scheduler.py +155 -0
- fivefold-0.1.0/tests/unit/test_identity.py +122 -0
- fivefold-0.1.0/tests/unit/test_import_boundaries.py +89 -0
- fivefold-0.1.0/tests/unit/test_invariants.py +700 -0
- fivefold-0.1.0/tests/unit/test_live.py +491 -0
- fivefold-0.1.0/tests/unit/test_live_providers.py +532 -0
- fivefold-0.1.0/tests/unit/test_mcp_link.py +456 -0
- fivefold-0.1.0/tests/unit/test_migration_files.py +96 -0
- fivefold-0.1.0/tests/unit/test_package_data.py +78 -0
- fivefold-0.1.0/tests/unit/test_policy.py +461 -0
- fivefold-0.1.0/tests/unit/test_prices.py +166 -0
- fivefold-0.1.0/tests/unit/test_publish_workflow.py +55 -0
- fivefold-0.1.0/tests/unit/test_random_plan.py +382 -0
- fivefold-0.1.0/tests/unit/test_record_and_replay.py +443 -0
- fivefold-0.1.0/tests/unit/test_registry.py +51 -0
- fivefold-0.1.0/tests/unit/test_report.py +70 -0
- fivefold-0.1.0/tests/unit/test_report_sink.py +58 -0
- fivefold-0.1.0/tests/unit/test_resolver.py +563 -0
- fivefold-0.1.0/tests/unit/test_rules.py +282 -0
- fivefold-0.1.0/tests/unit/test_run_models.py +159 -0
- fivefold-0.1.0/tests/unit/test_scenario.py +431 -0
- fivefold-0.1.0/tests/unit/test_scheduler.py +509 -0
- fivefold-0.1.0/tests/unit/test_scripted_imports.py +32 -0
- fivefold-0.1.0/tests/unit/test_sim_api.py +258 -0
- fivefold-0.1.0/tests/unit/test_sim_points.py +343 -0
- fivefold-0.1.0/tests/unit/test_split.py +562 -0
- fivefold-0.1.0/tests/unit/test_state_machine_table.py +246 -0
- fivefold-0.1.0/tests/unit/test_study.py +336 -0
- fivefold-0.1.0/tests/unit/test_transport.py +597 -0
- fivefold-0.1.0/tests/unit/test_viewer_cli.py +44 -0
- fivefold-0.1.0/tests/unit/test_viewer_source.py +92 -0
- fivefold-0.1.0/tests/unit/test_viewer_timeline.py +81 -0
- fivefold-0.1.0/tests/unit/test_wait_limit.py +81 -0
- fivefold-0.1.0/tests/unit/test_wire.py +148 -0
- fivefold-0.1.0/tests/unit/test_worker.py +189 -0
- fivefold-0.1.0/uv.lock +1591 -0
- fivefold-0.1.0/viewer/.gitignore +3 -0
- fivefold-0.1.0/viewer/.npmrc +1 -0
- fivefold-0.1.0/viewer/Dockerfile +30 -0
- fivefold-0.1.0/viewer/e2e/check.mjs +106 -0
- fivefold-0.1.0/viewer/eslint.config.js +25 -0
- fivefold-0.1.0/viewer/index.html +13 -0
- fivefold-0.1.0/viewer/package-lock.json +3732 -0
- fivefold-0.1.0/viewer/package.json +44 -0
- fivefold-0.1.0/viewer/src/App.tsx +30 -0
- fivefold-0.1.0/viewer/src/api.ts +39 -0
- fivefold-0.1.0/viewer/src/components/Compare.tsx +127 -0
- fivefold-0.1.0/viewer/src/components/Ledger.tsx +86 -0
- fivefold-0.1.0/viewer/src/components/RunList.tsx +121 -0
- fivefold-0.1.0/viewer/src/components/RunPage.tsx +46 -0
- fivefold-0.1.0/viewer/src/components/Scorecard.tsx +121 -0
- fivefold-0.1.0/viewer/src/components/Timeline.tsx +87 -0
- fivefold-0.1.0/viewer/src/components/common.tsx +34 -0
- fivefold-0.1.0/viewer/src/components.test.tsx +201 -0
- fivefold-0.1.0/viewer/src/describe.test.ts +51 -0
- fivefold-0.1.0/viewer/src/describe.ts +187 -0
- fivefold-0.1.0/viewer/src/load.ts +25 -0
- fivefold-0.1.0/viewer/src/main.tsx +13 -0
- fivefold-0.1.0/viewer/src/route.test.ts +29 -0
- fivefold-0.1.0/viewer/src/route.ts +50 -0
- fivefold-0.1.0/viewer/src/runData.ts +29 -0
- fivefold-0.1.0/viewer/src/styles.css +312 -0
- fivefold-0.1.0/viewer/src/test/fixtures.ts +380 -0
- fivefold-0.1.0/viewer/src/types.ts +226 -0
- fivefold-0.1.0/viewer/src/views.test.ts +117 -0
- fivefold-0.1.0/viewer/src/views.ts +174 -0
- fivefold-0.1.0/viewer/tsconfig.json +20 -0
- fivefold-0.1.0/viewer/vite.config.ts +15 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Deterministic checks on every pull request and every push to main (0007).
|
|
2
|
+
# Live-model runs never run in CI.
|
|
3
|
+
name: CI
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
check:
|
|
15
|
+
name: Lint, type check and test
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
services:
|
|
18
|
+
postgres:
|
|
19
|
+
image: postgres:16.15
|
|
20
|
+
env:
|
|
21
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
|
22
|
+
ports:
|
|
23
|
+
- 5432:5432
|
|
24
|
+
options: >-
|
|
25
|
+
--health-cmd "pg_isready -U postgres"
|
|
26
|
+
--health-interval 2s
|
|
27
|
+
--health-timeout 3s
|
|
28
|
+
--health-retries 30
|
|
29
|
+
env:
|
|
30
|
+
FIVEFOLD_ADMIN_DSN: postgresql://postgres@127.0.0.1:5432/postgres
|
|
31
|
+
HYPOTHESIS_PROFILE: ci
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
- name: Install uv
|
|
38
|
+
run: pip install uv==0.13.8
|
|
39
|
+
- name: Install locked dependencies
|
|
40
|
+
run: uv sync --locked
|
|
41
|
+
- name: Lint
|
|
42
|
+
run: make lint
|
|
43
|
+
- name: Type check
|
|
44
|
+
run: make typecheck
|
|
45
|
+
- name: Test
|
|
46
|
+
run: make test
|
|
47
|
+
|
|
48
|
+
packaging:
|
|
49
|
+
name: Installed wheel demo
|
|
50
|
+
runs-on: ubuntu-24.04
|
|
51
|
+
services:
|
|
52
|
+
postgres:
|
|
53
|
+
image: postgres:16.15
|
|
54
|
+
env:
|
|
55
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
|
56
|
+
ports:
|
|
57
|
+
- 5432:5432
|
|
58
|
+
options: >-
|
|
59
|
+
--health-cmd "pg_isready -U postgres"
|
|
60
|
+
--health-interval 2s
|
|
61
|
+
--health-timeout 3s
|
|
62
|
+
--health-retries 30
|
|
63
|
+
env:
|
|
64
|
+
FIVEFOLD_ADMIN_DSN: postgresql://postgres@127.0.0.1:5432/postgres
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
- uses: actions/setup-python@v5
|
|
68
|
+
with:
|
|
69
|
+
python-version: "3.12"
|
|
70
|
+
- name: Install uv
|
|
71
|
+
run: pip install uv==0.13.8
|
|
72
|
+
- name: Build the sdist and wheel
|
|
73
|
+
run: uv build --out-dir dist
|
|
74
|
+
- name: Check the PyPI description
|
|
75
|
+
run: |
|
|
76
|
+
python -m pip install twine==7.0.0 'readme-renderer[md]==46.0'
|
|
77
|
+
python -m twine check --strict dist/*
|
|
78
|
+
python scripts/check_pypi_readme.py dist/*.whl dist/*.tar.gz
|
|
79
|
+
- name: Run demo 1 from the installed wheel outside the checkout
|
|
80
|
+
run: |
|
|
81
|
+
smoke=$(mktemp -d)
|
|
82
|
+
uv venv --python 3.12 "$smoke/venv"
|
|
83
|
+
uv pip install --python "$smoke/venv/bin/python" dist/*.whl
|
|
84
|
+
cd "$smoke"
|
|
85
|
+
"$smoke/venv/bin/python" -m fivefold.harness.demo 1
|
|
86
|
+
|
|
87
|
+
identities:
|
|
88
|
+
name: Commit identities
|
|
89
|
+
# Every commit of a pull request must use GitHub noreply addresses (CLAUDE.md,
|
|
90
|
+
# "Commits and attribution"). The check never prints what it refuses.
|
|
91
|
+
if: github.event_name == 'pull_request'
|
|
92
|
+
runs-on: ubuntu-24.04
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v4
|
|
95
|
+
with:
|
|
96
|
+
fetch-depth: 0
|
|
97
|
+
- name: Check every commit's author and committer
|
|
98
|
+
run: python3 scripts/check_identities.py "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
|
|
99
|
+
|
|
100
|
+
viewer:
|
|
101
|
+
name: Viewer build, lint and test
|
|
102
|
+
# The viewer's frontend (0012) on Node's current LTS line; the Python jobs never need Node.
|
|
103
|
+
runs-on: ubuntu-24.04
|
|
104
|
+
defaults:
|
|
105
|
+
run:
|
|
106
|
+
working-directory: viewer
|
|
107
|
+
steps:
|
|
108
|
+
- uses: actions/checkout@v4
|
|
109
|
+
- uses: actions/setup-node@v4
|
|
110
|
+
with:
|
|
111
|
+
node-version: "26.13.1"
|
|
112
|
+
cache: npm
|
|
113
|
+
cache-dependency-path: viewer/package-lock.json
|
|
114
|
+
- name: Install locked dependencies
|
|
115
|
+
run: npm ci
|
|
116
|
+
- name: Lint
|
|
117
|
+
run: npm run lint
|
|
118
|
+
- name: Test
|
|
119
|
+
run: npm test
|
|
120
|
+
- name: Type check and build
|
|
121
|
+
run: npm run build
|
|
122
|
+
|
|
123
|
+
container:
|
|
124
|
+
name: Compose file and app image
|
|
125
|
+
runs-on: ubuntu-24.04
|
|
126
|
+
steps:
|
|
127
|
+
- uses: actions/checkout@v4
|
|
128
|
+
- name: Validate the Compose file, with each profile
|
|
129
|
+
run: |
|
|
130
|
+
docker compose config --quiet
|
|
131
|
+
docker compose --profile app config --quiet
|
|
132
|
+
docker compose --profile viewer config --quiet
|
|
133
|
+
docker compose --profile split config --quiet
|
|
134
|
+
- name: Build the app image
|
|
135
|
+
run: docker build .
|
|
136
|
+
- name: Build the viewer image
|
|
137
|
+
run: docker build --file viewer/Dockerfile .
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Nightly property tests with far more examples than CI (0007). Hypothesis prints a
|
|
2
|
+
# reproduction blob for every failure, and the job uploads its example database.
|
|
3
|
+
name: Nightly
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: "17 3 * * *"
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
properties:
|
|
15
|
+
name: Property tests (nightly profile)
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
services:
|
|
18
|
+
postgres:
|
|
19
|
+
image: postgres:16.15
|
|
20
|
+
env:
|
|
21
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
|
22
|
+
ports:
|
|
23
|
+
- 5432:5432
|
|
24
|
+
options: >-
|
|
25
|
+
--health-cmd "pg_isready -U postgres"
|
|
26
|
+
--health-interval 2s
|
|
27
|
+
--health-timeout 3s
|
|
28
|
+
--health-retries 30
|
|
29
|
+
env:
|
|
30
|
+
FIVEFOLD_ADMIN_DSN: postgresql://postgres@127.0.0.1:5432/postgres
|
|
31
|
+
HYPOTHESIS_PROFILE: nightly
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
- name: Install uv
|
|
38
|
+
run: pip install uv==0.13.8
|
|
39
|
+
- name: Install locked dependencies
|
|
40
|
+
run: uv sync --locked
|
|
41
|
+
- name: Test
|
|
42
|
+
run: make test
|
|
43
|
+
- name: Upload failing examples
|
|
44
|
+
if: failure()
|
|
45
|
+
uses: actions/upload-artifact@v4
|
|
46
|
+
with:
|
|
47
|
+
name: hypothesis-examples
|
|
48
|
+
path: .hypothesis/
|
|
49
|
+
if-no-files-found: ignore
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Publishes FiveFold to PyPI when a GitHub release is published, through PyPI's
|
|
2
|
+
# Trusted Publishing: no token is stored anywhere. The build job checks that the
|
|
3
|
+
# release's tag is v plus the version in pyproject.toml, builds the sdist and the
|
|
4
|
+
# wheel, installs the wheel outside the repository and runs demo 1 from it, so a
|
|
5
|
+
# package that cannot run is never published. The publish job runs in the GitHub
|
|
6
|
+
# environment `pypi`, whose protection rules apply before anything is published.
|
|
7
|
+
name: Publish
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
release:
|
|
11
|
+
types: [published]
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build:
|
|
18
|
+
name: Build and check the distributions
|
|
19
|
+
runs-on: ubuntu-24.04
|
|
20
|
+
services:
|
|
21
|
+
postgres:
|
|
22
|
+
image: postgres:16.15
|
|
23
|
+
env:
|
|
24
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
|
25
|
+
ports:
|
|
26
|
+
- 5432:5432
|
|
27
|
+
options: >-
|
|
28
|
+
--health-cmd "pg_isready -U postgres"
|
|
29
|
+
--health-interval 2s
|
|
30
|
+
--health-timeout 3s
|
|
31
|
+
--health-retries 30
|
|
32
|
+
env:
|
|
33
|
+
FIVEFOLD_ADMIN_DSN: postgresql://postgres@127.0.0.1:5432/postgres
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
- uses: actions/setup-python@v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
- name: Install uv
|
|
40
|
+
run: pip install uv==0.13.8
|
|
41
|
+
- name: Check that the release tag names the package's version
|
|
42
|
+
run: |
|
|
43
|
+
version=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
|
|
44
|
+
tag="${GITHUB_REF#refs/tags/}"
|
|
45
|
+
if [ "$tag" != "v$version" ]; then
|
|
46
|
+
echo "The release tag is $tag, but pyproject.toml says version $version: tag the release v$version."
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
- name: Build the sdist and the wheel
|
|
50
|
+
run: uv build --out-dir dist
|
|
51
|
+
- name: Run demo 1 from the installed wheel, outside the repository
|
|
52
|
+
run: |
|
|
53
|
+
smoke=$(mktemp -d)
|
|
54
|
+
uv venv --python 3.12 "$smoke/venv"
|
|
55
|
+
uv pip install --python "$smoke/venv/bin/python" dist/*.whl
|
|
56
|
+
cd "$smoke"
|
|
57
|
+
"$smoke/venv/bin/python" -m fivefold.harness.demo 1
|
|
58
|
+
- uses: actions/upload-artifact@v7
|
|
59
|
+
with:
|
|
60
|
+
name: dist
|
|
61
|
+
path: dist/
|
|
62
|
+
|
|
63
|
+
publish:
|
|
64
|
+
name: Publish to PyPI
|
|
65
|
+
needs: build
|
|
66
|
+
runs-on: ubuntu-24.04
|
|
67
|
+
environment:
|
|
68
|
+
name: pypi
|
|
69
|
+
url: https://pypi.org/p/fivefold
|
|
70
|
+
permissions:
|
|
71
|
+
id-token: write
|
|
72
|
+
steps:
|
|
73
|
+
- uses: actions/download-artifact@v8
|
|
74
|
+
with:
|
|
75
|
+
name: dist
|
|
76
|
+
path: dist/
|
|
77
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Local working wiki for agents and maintainers. Never published.
|
|
2
|
+
/wiki
|
|
3
|
+
|
|
4
|
+
# Python
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
.venv/
|
|
8
|
+
.mypy_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.hypothesis/
|
|
12
|
+
|
|
13
|
+
# Environment files and secrets
|
|
14
|
+
.env
|
|
15
|
+
.env.*
|
|
16
|
+
|
|
17
|
+
# A split run's directory, which holds the run's secrets (python -m fivefold.harness.split)
|
|
18
|
+
/split-run/
|
|
19
|
+
|
|
20
|
+
# Operating system files
|
|
21
|
+
.DS_Store
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
fivefold-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (18 Nov 2026)
|
|
4
|
+
|
|
5
|
+
FiveFold's first full release is a test suite and reference gateway for agents that take actions in a procurement simulator. It scores five properties from the simulator ledger and harness records.
|
|
6
|
+
|
|
7
|
+
- **M0, design freeze.** Defined action identity, grants, the gateway state machine, the five properties, tool contracts and the fault catalog. Set up CI and Docker Compose.
|
|
8
|
+
- **M1, thin slice.** Added the first scripted LangGraph agent, a deterministic scheduler and the reference gateway. Demo 1 shows what happens when a purchase-order reply is lost.
|
|
9
|
+
- **M2, authority and freshness.** Added the scripted approver, the C0 to C3 contract levels, revocation, expiry and stale-input checks. The evaluator covers all five properties, and Hypothesis checks invariants I1 to I7.
|
|
10
|
+
- **M3, full scenarios.** Added demo 2a (a quote changes after approval, F7), demo 2b (an approval is revoked, F6), and demo 3 (an outcome nobody can confirm, F2 with no resolver). The full scenario suite covers 11 fault types across 235 checked cells. Added recorded playback and an evidence viewer with timelines and scorecards.
|
|
11
|
+
- **M4, live study.** Published the local and API pilots and the full study of 1,482 live episodes. The [report](docs/report.md) links to the raw data and compares the baseline, approval gate and reference gateway.
|
|
12
|
+
- **M5, release.** Published the Python package, the two-minute setup and [twenty-minute tour](docs/tour.md), the overview video, the [limitations](docs/limitations.md) and the [security policy](SECURITY.md).
|
|
13
|
+
|
|
14
|
+
The release also includes the admin API for resolving unknown outcomes, experimental branching, the split topology for bringing your own agent, and live adapters for Ollama, Anthropic, OpenAI and Google.
|
|
15
|
+
|
|
16
|
+
### Known issue
|
|
17
|
+
|
|
18
|
+
In the split topology, an agent worker can end with `MCPError: Session not found` when its MCP session is lost. This happened once in about 40 CI runs. All 30 targeted runs passed. The demos, the 235 expected outcomes, and the full study use the in-process topology, which uses a separate transport. [Tracking issue #101](https://github.com/samrusani/FiveFold/issues/101)
|
|
19
|
+
|
|
20
|
+
## 0.1.0a1 (17 Nov 2026)
|
|
21
|
+
|
|
22
|
+
First PyPI pre-release. It packaged the demo and its scenario and migration data so demo 1 could run from an installed wheel.
|
fivefold-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Rules for every coding agent working in this repo.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
FiveFold is an open-source test suite and reference gateway. It checks whether AI agents act correctly under failure: every real-world action happens exactly once, with valid authority, on fresh inputs, is actually committed, and is honestly reported.
|
|
8
|
+
|
|
9
|
+
Read these before writing code, in this order:
|
|
10
|
+
|
|
11
|
+
1. `docs/product.md`: what and why, scope, non-goals
|
|
12
|
+
2. `docs/spec.md`: the contracts you build against
|
|
13
|
+
3. `docs/plan.md`: milestones, teams, tickets
|
|
14
|
+
4. `docs/adr/`: the accepted decision records, which hold the detail and reasoning behind the spec
|
|
15
|
+
|
|
16
|
+
## Who decides what
|
|
17
|
+
|
|
18
|
+
- **The maintainer owns the semantics:** action identity, grant lifecycle, states and transitions, invariants I1 to I7, the five property definitions, tool names and return shapes, tool contract levels, and fault IDs.
|
|
19
|
+
- To change any of those, write a decision record in `docs/adr/` with status **Proposed** and stop. Do not mark it Accepted yourself.
|
|
20
|
+
- Everything else (internal module structure, helper names, test layout) is yours, as long as it serves the spec.
|
|
21
|
+
|
|
22
|
+
## Hard rules
|
|
23
|
+
|
|
24
|
+
- **No invented APIs.** Before calling any library function, confirm it in the official docs or the installed package source. If you are unsure a function exists, say so in the PR instead of guessing.
|
|
25
|
+
- **In gateway configurations (G1, G2), the agent holds no simulator credential,** and only the gateway writes to the simulator. Baselines (B0, B1, B2) write directly by design; that is what they measure (0008).
|
|
26
|
+
- **The gateway and the simulator never share a database transaction.** They connect with separate roles that cannot touch each other's tables (0008).
|
|
27
|
+
- **The evaluator never calls a model.** It decides pass or fail only from simulator and harness records, and reads the gateway's tables only to explain failures (0004).
|
|
28
|
+
- **Every state transition is one database transaction** with row locks, and is logged append-only in ActionEvent. No network call happens inside a database transaction (0003).
|
|
29
|
+
- **Determinism:** every component, the gateway included, reads time only from the run's virtual clock and randomness only from the run's seeded generators (0009). Wall-clock time is recorded for metrics only. Lint bans wall-clock calls and global randomness outside the clock and generator modules (0007).
|
|
30
|
+
- **Held-out scenarios are off-limits.** They live outside this repo. Never search for, read or recreate them.
|
|
31
|
+
- **No live model calls in CI.** Live runs sit behind an explicit flag and a budget cap.
|
|
32
|
+
- **No secrets in the repo.** Keys come from environment variables.
|
|
33
|
+
- **Stay in scope.** The non-goals in `docs/product.md` are binding: no agent framework, no execution engine, no model router, no receipts or TEE in v0.1.
|
|
34
|
+
|
|
35
|
+
## Tests
|
|
36
|
+
|
|
37
|
+
- Every fault variant has deterministic tests for every applicable (contract, configuration) cell, asserting the verdict and failing properties in `faults/expected.yaml` (0006). For every fault except F1, F10 and F12, at least one cell shows B0 failing where G2 passes.
|
|
38
|
+
- Invariants I1 to I7 are asserted in code and exercised by Hypothesis rule-based state machine tests.
|
|
39
|
+
- A PR that changes behaviour includes a test that would have caught the old behaviour.
|
|
40
|
+
|
|
41
|
+
## Pull requests
|
|
42
|
+
|
|
43
|
+
- One ticket per PR, kept small. Keep one open PR per branch, and restart the branch from `main` after each merge. When a reviewer merges a sprint's PRs together at its end, stack them: each ticket's branch starts from the previous ticket's branch, and every PR targets `main`.
|
|
44
|
+
- The description names the spec section and decision records it implements, lists each library API it uses with where it was checked (a docs URL, or the installed source path and version), and states anything left uncertain.
|
|
45
|
+
- Dependency upgrades are separate PRs. An upgrade of LangGraph, langgraph-prebuilt or the MCP SDK re-checks the facts that 0008 and 0009 pin.
|
|
46
|
+
- Run the full deterministic suite before asking for review.
|
|
47
|
+
|
|
48
|
+
## Commits and attribution
|
|
49
|
+
|
|
50
|
+
- Treat this repository as public. Never commit secrets, personal names, personal email addresses, local paths or machine details. Allowed: the maintainer's GitHub username, `samrusani`; GitHub noreply addresses in commit metadata; the contact address in `CODE_OF_CONDUCT.md`, which the maintainer chose as the project's public contact; and links to other people's public work in citations.
|
|
51
|
+
- No tool attribution in commits, pull requests or docs: no "Generated with" footers, no AI co-author trailers and no session links.
|
|
52
|
+
- Agents working for the maintainer commit as `samrusani <samrusani@users.noreply.github.com>`. Other contributors use their own GitHub noreply address.
|
|
53
|
+
- Before every push, check each new commit's author and committer. CI's commit identity check (`scripts/check_identities.py`) fails a pull request whose commits use any address that is not a GitHub noreply address, or the maintainer's address under another name.
|
|
54
|
+
|
|
55
|
+
## Working wiki
|
|
56
|
+
|
|
57
|
+
- Agents keep working notes in `wiki/` at the repo root: status, roadmap, processes, learnings and a log. It is gitignored and never published.
|
|
58
|
+
- If `wiki/` exists, read `wiki/index.md` and `wiki/status.md` before starting, and follow `wiki/AGENTS.md`.
|
|
59
|
+
- Before finishing a session, update the pages you touched, `wiki/status.md` and `wiki/log.md`.
|
|
60
|
+
- Nothing moves from the wiki into the repository unless it passes the rules above.
|
|
61
|
+
|
|
62
|
+
## Writing style for docs and the report
|
|
63
|
+
|
|
64
|
+
- Short sentences, plain words, specific numbers with units.
|
|
65
|
+
- No em dashes. Use commas, semicolons, colons, parentheses or separate sentences.
|
|
66
|
+
- Avoid stock phrases such as "It's worth noting", "Notably", "In an era of", "The landscape of", "This underscores" and "a testament to".
|
|
67
|
+
- Cite papers by full title and arXiv ID, and label them as preprints.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
# Contributor Covenant 3.0 Code of Conduct
|
|
3
|
+
|
|
4
|
+
## Our Pledge
|
|
5
|
+
|
|
6
|
+
We pledge to make our community welcoming, safe, and equitable for all.
|
|
7
|
+
|
|
8
|
+
We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Encouraged Behaviors
|
|
12
|
+
|
|
13
|
+
While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
|
|
14
|
+
|
|
15
|
+
With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
|
|
16
|
+
|
|
17
|
+
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
|
|
18
|
+
2. Engaging **kindly and honestly** with others.
|
|
19
|
+
3. Respecting **different viewpoints** and experiences.
|
|
20
|
+
4. **Taking responsibility** for our actions and contributions.
|
|
21
|
+
5. Gracefully giving and accepting **constructive feedback**.
|
|
22
|
+
6. Committing to **repairing harm** when it occurs.
|
|
23
|
+
7. Behaving in other ways that promote and sustain the **well-being of our community**.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Restricted Behaviors
|
|
27
|
+
|
|
28
|
+
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
|
|
29
|
+
|
|
30
|
+
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
|
|
31
|
+
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
|
|
32
|
+
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
|
|
33
|
+
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
|
|
34
|
+
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
|
|
35
|
+
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
|
|
36
|
+
7. Behaving in other ways that **threaten the well-being** of our community.
|
|
37
|
+
|
|
38
|
+
### Other Restrictions
|
|
39
|
+
|
|
40
|
+
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
|
|
41
|
+
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
|
|
42
|
+
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
|
|
43
|
+
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Reporting an Issue
|
|
47
|
+
|
|
48
|
+
Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
|
|
49
|
+
|
|
50
|
+
When an incident does occur, it is important to report it promptly. To report a possible violation, email samgithub@pm.me.
|
|
51
|
+
|
|
52
|
+
Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Addressing and Repairing Harm
|
|
56
|
+
|
|
57
|
+
FiveFold's Community Moderator is its maintainer, [samrusani](https://github.com/samrusani), who handles reports and applies the enforcement ladder below.
|
|
58
|
+
|
|
59
|
+
If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
|
|
60
|
+
|
|
61
|
+
1) Warning
|
|
62
|
+
1) Event: A violation involving a single incident or series of incidents.
|
|
63
|
+
2) Consequence: A private, written warning from the Community Moderators.
|
|
64
|
+
3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
|
|
65
|
+
2) Temporarily Limited Activities
|
|
66
|
+
1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
|
|
67
|
+
2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
|
|
68
|
+
3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
|
|
69
|
+
3) Temporary Suspension
|
|
70
|
+
1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
|
|
71
|
+
2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
|
|
72
|
+
3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
|
|
73
|
+
4) Permanent Ban
|
|
74
|
+
1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
|
|
75
|
+
2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
|
|
76
|
+
3) Repair: There is no possible repair in cases of this severity.
|
|
77
|
+
|
|
78
|
+
This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Scope
|
|
82
|
+
|
|
83
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## Attribution
|
|
87
|
+
|
|
88
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
|
|
89
|
+
|
|
90
|
+
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
|
|
91
|
+
|
|
92
|
+
For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
|
|
93
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
FiveFold's first full release is `0.1.0`. The Status section of [README.md](README.md) says what is built and what is left. Open an issue to report a bug or question a design. Comment on a pull request to review a change. To report a vulnerability, follow [SECURITY.md](SECURITY.md) instead of opening an issue.
|
|
4
|
+
|
|
5
|
+
Follow the [Code of Conduct](CODE_OF_CONDUCT.md) when taking part in the community.
|
|
6
|
+
|
|
7
|
+
## How decisions are made
|
|
8
|
+
|
|
9
|
+
- The contracts live in `docs/spec.md`. The maintainer owns their meaning: action identity, the grant lifecycle, states and transitions, invariants, the five property definitions, tool names and return shapes, contract levels and fault IDs.
|
|
10
|
+
- To change any of these, open a pull request that adds a decision record in `docs/adr/`. Copy `0000-template.md`, set the status to **Proposed**, state the rule so that a test could check it, and list the alternatives you considered.
|
|
11
|
+
- Only the maintainer marks a record **Accepted**. Accepted records are binding, like the spec. The pull request that accepts a record also updates every document it affects.
|
|
12
|
+
|
|
13
|
+
## Development
|
|
14
|
+
|
|
15
|
+
You need Python 3.12, [uv](https://docs.astral.sh/uv/) 0.13.8 or later, and PostgreSQL 16. Put `uv` on your path. Two packaging tests run `uv build` and need network access for build dependencies. Docker Compose can run the database for you. The viewer's frontend also needs Node 26 and npm; the Python tests never do.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
make setup # install the locked dependencies into .venv
|
|
19
|
+
make db-up # start PostgreSQL 16 on 127.0.0.1:5432
|
|
20
|
+
make check # lint, type check and every test
|
|
21
|
+
make test-fast # only the tests that need no database
|
|
22
|
+
make demo # the four demos, for B0 and G2, from a seed
|
|
23
|
+
make help # every target
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
CI also builds the wheel, installs it outside the checkout and runs demo 1 against PostgreSQL 16.
|
|
27
|
+
|
|
28
|
+
The demos, the tests and every command that runs an episode connect with `FIVEFOLD_ADMIN_DSN`, which defaults to the Compose database, `postgresql://postgres@127.0.0.1:5432/postgres`. Any PostgreSQL 16 server works if that connection is a superuser and the component roles can log in. `db/bootstrap.sql` creates those roles without a password; the Compose database and CI trust local connections, so the roles need none there. Test runs that share one server at the same time need different `FIVEFOLD_TEST_DB_PREFIX` values.
|
|
29
|
+
|
|
30
|
+
Every run database is a copy of one migrated template database, `fivefold_template` (set `FIVEFOLD_TEMPLATE_DB` for another; the tests use their own). The demo, the study, the recorder and the split topology's `start` make the template if it is missing, migrate it forward if it is behind, and copy it; commands that copy at once take turns. PostgreSQL copies a database only while no other session is connected to it, so keep no session open on the template: a copy waits up to 5 seconds for one to end, then is refused. A template whose applied migrations no longer match `db/migrations`, such as one an edited migration was applied to, is refused too; drop it, and the next run makes it again.
|
|
31
|
+
|
|
32
|
+
## Pull requests
|
|
33
|
+
|
|
34
|
+
- Run `make check` before asking for review. The Development section below explains the setup.
|
|
35
|
+
- One change per pull request, kept small.
|
|
36
|
+
- Name the spec section or decision record it implements.
|
|
37
|
+
- List every library API you used and where you checked it: the official docs, or the installed package source with its version. If you are unsure an API exists, say so instead of guessing.
|
|
38
|
+
- Say what is still uncertain.
|
|
39
|
+
- A behaviour change includes a test that would have caught the old behaviour.
|
|
40
|
+
- Live model calls never run in CI.
|
|
41
|
+
|
|
42
|
+
## Releases
|
|
43
|
+
|
|
44
|
+
Releases go to PyPI through `.github/workflows/publish.yml`, with PyPI's Trusted Publishing, so no token is stored anywhere. To release:
|
|
45
|
+
|
|
46
|
+
1. In a pull request, set or confirm the version in `pyproject.toml`, such as `0.1.0`.
|
|
47
|
+
2. Once it merges, publish a GitHub release whose tag is `v` plus that version, such as `v0.1.0`.
|
|
48
|
+
3. The workflow checks the tag against the version, builds the sdist and the wheel, installs the wheel outside the repository and runs demo 1 from it. Only then does the publish job run, in the GitHub environment `pypi`, whose protection rules apply first.
|
|
49
|
+
|
|
50
|
+
## Writing style
|
|
51
|
+
|
|
52
|
+
Short sentences, plain words, specific numbers with units. No em dashes. Cite papers by full title and arXiv ID, and label them as preprints. The full rules are in [CLAUDE.md](CLAUDE.md).
|
|
53
|
+
|
|
54
|
+
## What never goes in the repository
|
|
55
|
+
|
|
56
|
+
- Secrets. Keys come from environment variables.
|
|
57
|
+
- Personal names, personal email addresses, local paths and machine details. GitHub noreply addresses in commit metadata, the public contact in `CODE_OF_CONDUCT.md`, and links to other people's public work in citations are fine.
|
|
58
|
+
- Held-out evaluation scenarios. They live outside this repository.
|
|
59
|
+
|
|
60
|
+
CI checks that every commit in a pull request uses a GitHub noreply address as author and committer.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
FiveFold is licensed under the Apache License 2.0. By contributing, you agree that your contributions are licensed under the same terms.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# The app image (0007): Python 3.12 with uv. By default it runs `make check`, which needs
|
|
2
|
+
# the postgres service from docker-compose.yml.
|
|
3
|
+
FROM python:3.12-slim
|
|
4
|
+
|
|
5
|
+
RUN apt-get update \
|
|
6
|
+
&& apt-get install --yes --no-install-recommends make \
|
|
7
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
RUN pip install --no-cache-dir uv==0.13.8
|
|
10
|
+
|
|
11
|
+
# Use the image's Python 3.12; never download another.
|
|
12
|
+
ENV UV_PYTHON_DOWNLOADS=never
|
|
13
|
+
|
|
14
|
+
WORKDIR /app
|
|
15
|
+
|
|
16
|
+
# Install the locked dependencies first, so code changes reuse this layer.
|
|
17
|
+
COPY pyproject.toml uv.lock ./
|
|
18
|
+
RUN uv sync --locked --no-install-project
|
|
19
|
+
|
|
20
|
+
COPY . .
|
|
21
|
+
RUN uv sync --locked
|
|
22
|
+
|
|
23
|
+
CMD ["make", "check"]
|