Skip to content

About

Human-reviewed phone capacity and exact surplus allocation; live CALL-E validation pending.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Surplus Switchboard

Current evidence update: one real46-second CALL-E fictional role-play completed. Structured REST result recovery remains unresolved; no automated result reconciliation or real donation is claimed. See actual call and support evidence, sanitized API request, and video. Historical verification notes below predate this call.133tests now pass.

Phone-confirmed capacity → human verification → exact constrained allocation.

A new CALL-E hackathon candidate, with an actually working local Python optimizer, safe call-request boundary, durable creation ledger, reconciliation CLI and browser demo. Not yet a completed eligible contest entry: CALL-E live calls have NOT been run.

Run without installing packages

Requires Python 3.10 or later; latest local verification used Python 3.12.14 on Windows. No paid service is used by these commands.

python app.py
# Open http://127.0.0.1:8791
python -m unittest discover -s tests -v
python optimizer.py sample.json --output result.json
python workflow.py demo --approve-fixture --output handoff.json

Opening index.html directly shows the bundled computed result. Editing inputs and recomputing requires app.py. Editing inputs, starting a run or encountering an error clears the old proposal and disables its download; a response arriving after an edit or reset cannot restore it. The HTTP service binds to loopback only and has no live-call endpoint. Do not expose it publicly as a production service.

What is distinctive

Calling more organizations is not necessarily the solution: a flexible donation can use the only recipient capable of taking an inflexible donation. The allocator re-routes earlier choices to preserve scarce compatibility. It first maximizes accepted integer portions, then minimizes portions multiplied by the input travel minutes. It emits a max-flow/min-cut equality check and an input hash.

In the constructed example, nearest-first proposes six portions; the exact allocation proposes twelve. This is a demonstration case, not field evidence, a percentage improvement estimate, or a new mathematical algorithm. The implementation uses established successive-shortest-augmenting-path logic. No worldwide novelty claim is made.

Constraints include shared recipient capacity, accepted categories, operator clearance, confirmation freshness, readiness, strict arrival-before-expiry and receiving cutoff. Every lane is assumed independently transportable. This is NOT vehicle routing, cold-chain validation, allergen verification, or a promise that all proposals can physically be delivered.

CALL-E integration state

calls.py contains a standard-library REST adapter to the documented CALL-E API, an exact request preview, a SQLite creation ledger, and bounded read/poll/resume support. The complete create → read → human review → reconcile path is tested with local fake transports. The live service remains unvalidated. No SDK was installed or mocked while claiming a live SDK test. See the checked contract and limitations.

A real outgoing request needs a valid number, documented recipient permission, an explicit UTC calling window, API credentials held in an environment variable, acknowledgment of authorization, and the exact preview digest. The supplied context file is deliberately historical/fictional, so it will fail live-time window validation rather than accidentally call someone.

# Only after an operator creates private, authorized real-context.json:
python calls.py real-context.json --output private-preview.json
# Inspect the private file's full destination, permission, time window and SHA.
# The console masks the phone. This preview places NO call.

# A separate, explicit action can place ONE REAL CALL:
# export CALLE_API_KEY=...  # Set privately; do not put in source control.
# python calls.py real-context.json --allow-live-call \
#   --acknowledge-authorization --approve-sha <EXACT_PREVIEW_SHA>

Changing the phone number, request quantity, permission reference or calling window invalidates the old approval. Creation state and request context are persisted before the request. Timeouts and malformed create responses enter a manual-reconciliation hold. Changing the preview or window cannot bypass an existing attempt for the same partner and batch. The adapter does not automatically retry creation, cancel, or start a second call. Deleting the database defeats duplicate protection: do not delete it to “retry.” Consent revocation can block a not-yet-started call; it cannot undo a call already created. Inspect the CALL-E dashboard for live cancellation or reconciliation; no cancellation endpoint is implemented here.

After a specifically approved real creation, use the returned request_sha to read its existing call. This command has no creation branch:

python calls.py --db calls.sqlite3 --read-request-sha <REQUEST_SHA> \
  --max-reads 6 --interval 5 --output provider-result.json

The adapter uses a 20-second network timeout. The read budget is 1–12 requests, separated by 5–10 seconds. Pending states may have task_completed: null; they remain ineligible for allocation. Pending results or read failures can resume the same call. All documented terminal results are cached durably and cannot be replaced by a later response. Failed/canceled calls stop polling with terminal_hold, preserve diagnostics and never trigger a redial. Exhausting the read budget is not a call failure or cancellation. Results, previews and review files are private and are never overwritten by these commands.

Inspect the actual provider dashboard, determine the actual capacity confirmation's UTC epoch time, and prepare a review using an existing planning snapshot whose partner, batch and category match the original request:

python workflow.py review planning.json provider-result.json --db calls.sqlite3 \
  --confirmed-at <ACTUAL_CONFIRMATION_UTC_EPOCH> --output private-review.json
# Inspect exact identity, statement, quote, quantity, time and review_sha.
python workflow.py reconcile planning.json provider-result.json --db calls.sqlite3 \
  --confirmed-at <ACTUAL_CONFIRMATION_UTC_EPOCH> \
  --approve-review-sha <EXACT_REVIEW_SHA> --acknowledge-evidence-review \
  --output private-handoff.json

The review binds the saved provider read, original request, confirmation timestamp and exact planning snapshot. Edited result files or another ledger are rejected. Freshness and final arrival/expiry checks use the current system clock; importing old evidence cannot refresh it. A single-category inquiry enables only that category for the recipient, so a produce inquiry cannot silently confirm bread capacity. The output contains the new snapshot, allocation proposal and approval references. No original input is mutated and no donation occurs.

Provider credentials authenticate REST reads; the local result envelope is not a signed provider attestation. Webhooks, webhook signatures and enterprise identity/role management are not implemented. The existing workflow.py demo stays explicitly fictional; its broad-category handoff is not passed through the live import path.

Consenting participant role-play

For a specifically authorized recorded demonstration, set "test_mode": true in the private call context. Omission or false keeps the existing organization inquiry unchanged. Test mode opens with AI, recording/transcription and fictional-quantity disclosures, asks whether the participant still wants to take part, avoids implying they represent an organization, and stops on refusal. It requests a conversation under 60 seconds and an end by 120 seconds. These are advisory instructions, not a provider-enforced duration cap. The current REST/MCP contracts expose no duration or hangup control; an independently effective cutoff and verified no-new-charge allowance are still required before any such call.

The request, approval digest, durable ledger and retrieved envelope retain the role-play flag and fictional scope. A private review labels an affirmative quantity fictional_capacity; it cannot become real organization capacity. A demonstration allocation additionally requires "simulation": true in an entirely fictional planning snapshot. The normal review → exact approval → reconcile commands then produce provider_role_play_simulation, with simulation labels on the plan/snapshot and the provider/request references in provenance. The numerical manager_verified field in that snapshot only enables the fictional optimizer; it is not a claim about a real manager. Removing the simulation flag while retaining role-play provenance is rejected. See the role-play demonstration procedure.

The contact schema assumes one recipient and three extracted fields: willing, capacity_portions, and evidence_quote. Capacity is an integer; zero accompanies unknown willingness or refusal. Positive results remain candidates for human approval and must be within the offered quantity. Only user transcript turns can support the quote; documented unknown turns remain available for inspection but cannot establish recipient evidence. A quoted substring does NOT establish semantic correctness, identity, consent to a donation, food safety, or legal compliance.

Tests and evidence

132 Python tests pass in the latest local run on Python 3.12.14. They include the existing 200 exhaustively enumerated allocation instances and 300 additional instances whose capacity, freshness, clearance, category and arrival eligibility oracle does not reuse the implementation's validator. They cover complete fake-provider orchestration, exact approval, concurrency, Windows database closure, crash recovery, stale replay, read budgets, malformed evidence and actual loopback HTTP requests. Eighteen contract tests exercise REST 0.7.0 pending/terminal states, nullable completion, transcript speakers and the supported request schema. Twenty-six role-play tests cover truthful prompts, unchanged default approvals, dual opt-in simulation, durable provenance, tamper rejection, refusal, retained no-redial/freshness boundaries and optimizer derivatives. Three additional HTTP checks verify simulation propagation and invalid-label rejection. These are synthetic responses, not authenticated service evidence. Fresh verification is in evidence/20260908_role_play_derivatives/; the earlier role-play evidence is preserved.

Nine separate local browser checks verified actual Python computation and JSON download, immediate invalidation on edits/errors, late-response handling, visible fictional role-play labels and their retention in downloads. Removing the simulation opt-in rejects recomputation and clears the previous result. Fresh sanitized results, screenshots and hashes are in evidence/20260908_role_play_derivatives/; older evidence is preserved separately. Optional browser checks require an existing Playwright installation and browser; they are not dependencies of the Python application. Run node tests/browser_regression.cjs http://127.0.0.1:8791 evidence/browser after starting app.py. PLAYWRIGHT_MODULE and BROWSER_EXECUTABLE can select already-installed runtimes.

Privacy and security limits

Examples are fictional. Do not commit actual contact numbers, consent records, API keys, transcripts or employer data. The SQLite ledger is local and unencrypted; attempted permissions hardening is not a production security guarantee. The HTTP UI is a single-operator demo, not an authenticated multi-user service. It generates proposals only: no actual reservation, allocation, purchase or donation occurs.

Contest target and remaining gates

CALL-E “Most Practical Use Case” is the primary target; feedback is a separate individual award, not another copy of this project. Official rules: https://call-e.devpost.com/rules

Before main entry: complete the account and eligibility checks using current entrant answers; execute and retain a real authorized smoke test; verify the actual response against the checked API contract; publish source and the required contribution to CALLE-AI/awesome-phone-call-agents under apps/python/surplus-switchboard/; record an honest under-three-minute demonstration; complete Devpost submission. Do not describe this local mock-backed demo as a functioning live telephone agent.

Official integration reference: https://github.com/CALLE-AI/call-e-integrations

Created with substantial AI assistance; the human entrant must understand, inspect and test the submission, and make truthful authorship disclosures.

About

Human-reviewed phone capacity and exact surplus allocation; live CALL-E validation pending.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages