diff --git a/docs/CAPABILITY_REGISTER.md b/docs/CAPABILITY_REGISTER.md new file mode 100644 index 00000000..f60f7225 --- /dev/null +++ b/docs/CAPABILITY_REGISTER.md @@ -0,0 +1,95 @@ +# Capability Register — ChatGPT-Web2API + +Status: proposed baseline for maintainer review (2026-11-21). +Baseline: [master@497527dceabfa3f95961e23c291e618c5570f1ac](https://github.com/Octo-Lex/ChatGPT-Web2API/tree/497527dceabfa3f95961e23c291e618c5570f1ac). +Companion: [Engineering Charter](ENGINEERING_CHARTER.md) (proposed); [Roadmap](ROADMAP.md). + +## Purpose and update rules + +Protect the product users already have, not every implementation detail. No regression may be hidden by deleting an old test, changing its expected result, or calling an implemented capability obsolete merely because the upstream UI changes. Unsupported behavior is not silently promised. A temporary upstream limitation is a recorded gap, not removal of the capability. + +Evidence axes: +- **Implementation**: M = present at the pinned merged baseline; P = proposed/unmerged; G = documented gap or not established. +- **Qualification**: S = source inspected; T = test coverage exists (not necessarily executed here); H = historical reported live/operational evidence, limited to its recorded environment/head; C = exact-head CI evidence. These labels can coexist. None means universal live acceptance. +- A README claim, model catalog, prior demo, fixture, or another project's implementation is not current-account proof. Record the exact head/env, scenario, date, outcome and evidence link on promotion. Preserve negative results. +- Each change affecting a capability must identify its ID, retain its user-visible contract or document the authorized replacement, and supply relevant regression and qualification evidence. A changed internal seam is not automatically a product regression; distinguish tests of the contract from tests of implementation details. + +## A. Original product proposition + +| ID | Protected capability / promise | Implementation / evidence | Limits to preserve honestly | +|---|---|---|---| +| CAP-01 | Use an authenticated ChatGPT Web session through real Chrome/CDP; no separate upstream OpenAI API key or manual token extraction required | M/S/H; README, CHANGELOG 0.1.0, chrome.py, backend_client.py | User login and subscription/account entitlements, provider controls and usage limits apply; local optional API authentication is a different boundary. Not an official OpenAI API or a guarantee of free/unlimited use. | +| CAP-02 | Simple install and start; CLI, persistent browser session, first-run login | M/S/H; README, CHANGELOG, service.py, chrome.py | No forced extra services for basic single-user mode. Account/profile state is not request/session ownership. | +| CAP-03 | OpenAI-style REST chat completions, both documented URL aliases | M/S/T/H; api_server.py, test_unit.py, test_e2e_chat.py | Compatibility subset, not full OpenAI API parity. | +| CAP-04 | True incremental REST SSE, terminal status and final marker | M/S/T/H; api_server.py, completion_detector.py, test_sse_end_turn_new_chat.py, test_e2e_sse.py | HTTP status may already be committed; incomplete/error stream must not be signaled as success. No silent conversion to buffered-only output. | +| CAP-05 | Discover available models and map common model aliases; select model where supported | M/S/T/H; api_server.py, backend_client.py, chatgpt_dom.py, test_e2e_reads.py | Model slugs/availability drift. Selection can fall back today; do not imply verified requested model when not known. Token usage fields are placeholders (zero), not billing telemetry. | +| CAP-06 | Explicit conversation continuation and existing auto-continue | M/S/T/H; api_server.py, mcp_server.py, test_conversation_guard.py, CHANGELOG 0.2.0 | Preserve convenient continuity within the correct session; not permission to continue another client's conversation. Fresh navigation defects remain open. | +| CAP-07 | Project-scoped chat, default project and project discovery (REST /v1/projects and MCP) | M/S/T/H; api_server.py, mcp_server.py, backend_client.py, CHANGELOG | Respect target project and upstream context/memory rules; project association is not a guarantee of model recall. | +| CAP-08 | System instructions via message prepend; project instructions for persistent context | M/S/T/H; api_server.py, mcp_server.py, CHANGELOG | Prepending text is not native API system-role semantics. | +| CAP-09 | MCP SSE and stdio transports with agent-friendly tool results and progress | M/S/T/H; mcp_server.py, test_integration.py, test_progress.py, test_e2e_mcp.py | SSE recommended; stdio remains supported. MCP progress is not necessarily a live text stream; final tool results are collected. | +| CAP-10 | Non-text response completion and meaningful placeholder/retrieval guidance | M/S/T/H; completion_detector.py, cdp_driver.py, test_non_text_response.py, PR #44 | Existing placeholder behavior is not binary/image delivery, attachment upload or full rich artifact support. | + +REST also exposes GET /health and GET / as health alias. API schemas and client-visible fields must be retained or migrated deliberately. Historical feature claims: [README](../README.md), [CHANGELOG](../CHANGELOG.md), [API reference](api-reference.md). + +## B. MCP tool and discovery surface + +All 16 tools below exist at the pinned baseline (M/S); gating is verified in source and test coverage exists. The historical changelog reports 13/13 tools passing for 0.2.0, later live read/chat and project create/update evidence, and a 16-tool opt-in E2E suite. This is **not** a claim of all 16 live-passing now. Record individual tool qualification after explicit authorized tests; destructive operations require separate consent, isolated test data and cleanup. + +| ID | Tool | Retained contract | Exposure | +|---|---|---|---| +| MCP-01 | chat_completion | Chat, model, optional system prompt, explicit conversation/project, content/model/conversation_id result | Default | +| MCP-02 | list_models | Discover model slugs/catalog | Default | +| MCP-03 | list_projects | Discover projects and IDs | Default | +| MCP-04 | create_project | Create actual project; instructions and supported memory_scope (shared/default or project-only) | Write opt-in | +| MCP-05 | delete_project | Irreversible project deletion | Destructive opt-in | +| MCP-06 | update_project_instructions | Update persistent project instructions | Write opt-in | +| MCP-07 | list_project_files | List project files (not upload/download guarantee) | Default | +| MCP-08 | list_conversations | List chats, pagination | Default | +| MCP-09 | get_conversation | Paginated user/assistant history of current branch, oldest-first; total/has_more | Default | +| MCP-10 | archive_conversation | Archive/unarchive | Write opt-in | +| MCP-11 | delete_conversation | Delete a specific conversation | Destructive opt-in | +| MCP-12 | list_memories | Read account memories exposed by upstream | Default | +| MCP-13 | create_memory | Request memory creation using chat mechanism | Write opt-in | +| MCP-14 | delete_memory | Delete upstream memory by ID | Destructive opt-in | +| MCP-15 | list_gpts | Discover Custom GPTs | Default | +| MCP-16 | chat_with_gpt | Chat with specified Custom GPT | Default | + +MCP-17: resources, resource templates, prompts, argument completion, Pydantic inputs, rich descriptions, ToolAnnotations, structured output schemas, call-time enforcement (M/S/T). Maintain protocol parity between singleton and pooled paths. +MCP-18: risk-tier gate (M/S/T): W2A_ENABLE_WRITE=1 enables four write tools; W2A_ENABLE_DESTRUCTIVE=1 enables three destructive tools; nine default tools include chat (which DOES mutate chat state). Hidden tools are refused at call time. Do not conflate this gate with authentication. Preserve loopback default and honest auth metadata; review network exposure independently. + +Sources: mcp_server.py, config.py, backend_client.py; test_gating.py, test_business.py, test_deep.py, test_integration.py, test_e2e_reads.py, test_e2e_destructive.py, test_e2e_mcp.py. Memory changes upstream may affect live availability; retain discovery/management intent, report provider limitation rather than fabricate success or bypass unavailable features. + +## C. Operational and architectural achievements + +| ID | Capability | State/evidence and boundary | +|---|---|---| +| OPS-01 | Chrome launch/attach/monitor/restart and token/session refresh | M/S/T; chrome.py, cdp_transport.py, backend_client.py; historical CHANGELOG. Only owner may restart Chrome. | +| OPS-02 | ensure point-in-time readiness and ZCode hook integration | M/S/T/H; #15, #17, #20, #44, test_ensure.py. Not a continuous supervisor; REST owns Chrome, SSE attaches. | +| OPS-03 | Honest /health and breakers (including auth recovery) | M/S/T; #18–20; test_health.py, test_breakers.py, test_breaker_failfast.py. Health is not proof of a successful request. | +| OPS-04 | Rate-limit classification, bounded backoff, REST 429/Retry-After and MCP structured error | M/S/T; resilience.py, test_api_rate_limit.py, test_mcp_rate_limit.py, test_retry_after.py. Preserve safe recovery; existing whole-turn retry after dispatch is NOT guaranteed safe. | +| OPS-05 | Reactive diagnostics and doctor / read-only verification | M/S/T/H; CHANGELOG, test_diagnostics.py, test_doctor.py, test_e2e_doctor.py. Opt-in capture; redact tokens and sensitive payloads. Do not authorize write probes implicitly. | +| OPS-06 | Parallel per-target mutation locks, owned tabs, separate instance registry/lifecycle | M/S/T/H; #33–37, [operational validation](operational-validation.md), test_parallel_tabs_pr4.py, test_lock_resolver.py, test_tab_registry.py. Default off; don't mix worker locking modes; shared account is not tenant isolation. | +| OPS-07 | A1 trusted pre-send baseline and A2 turn-anchored reconciliation (UUID and qualified fallback) | M/S/T/H; #38–39, test_send_baseline.py, test_identity_listener.py, test_turn_anchor.py. #39 reports 20/20 canaries for reproduced stale-return; scoped, not universal. | +| OPS-08 | B1 MCP session-affine bounded lazy driver pool | M/S/T/H; #42, mcp_driver_pool.py, session_key.py, test_mcp_driver_pool.py, test_session_key.py. Default off; size 2, requires parallel_tabs + owned. Structural live canary on 142f2bb; full account-burst qualification pending. No REST pooling or account isolation. README pre-B1 warning is stale as a statement of code availability, remains true of unpooled mode. | +| OPS-09 | Model-aware first-content/idle/hard budgets and non-text propagation handling | M/S/T/H; #44, test_detector_budgets.py, test_non_text_response.py. Preserve slow-but-progressing and reasoning cases. | +| OPS-10 | Safe ownership loss and reconnect; no adopt of unrelated tab in owned mode | M/S/T/H; #44, test_owned_mode_no_adopt.py, test_tab_isolation.py. Read recovery does not confer write replay rights. | +| OPS-11 | Modular stable CDPDriver facade and collaborator seams | M/S/T; #22–26, docs/architecture.md, ROADMAP Phase 5. Preserve compatibility seams until migration evidence exists, not every internal line. | +| OPS-12 | Cross-platform packaging, non-e2e CI matrix and separately opted-in live tests | M/S/T/C; .github/workflows/ci.yml; test_e2e_gate.py. Windows/Linux/macOS Python 3.11/3.12 matrix; not universal platform live certification. | + +## D. Evidence ledger and unresolved work + +| Reference | What is supported | What is NOT supported | +|---|---|---| +| [Master CI 29195499536](https://github.com/Octo-Lex/ChatGPT-Web2API/actions/runs/29195499536) | Exact baseline SHA: all six test jobs and secret-scan succeeded; lint failed; build skipped | All-green baseline, new live test, or claim all features work today | +| [PR #39](https://github.com/Octo-Lex/ChatGPT-Web2API/pull/39) | Merged A2; historical stale-return repro and scoped 20/20 fresh canaries reported | Universal correlation across later branches, repeats and timing cases | +| [PR #42](https://github.com/Octo-Lex/ChatGPT-Web2API/pull/42) | Merged default-off B1; reported structural isolation, reuse and size cap | Full concurrent account workload, default-on safety | +| [PR #44](https://github.com/Octo-Lex/ChatGPT-Web2API/pull/44) | Merged reliability improvements; reported 678 tests and 3/3 historical non-text race verification | Latest CI green or current-UI acceptance | +| [PR #52](https://github.com/Octo-Lex/ChatGPT-Web2API/pull/52) | P: no-replay send primitive, opt-in single_send and unknown-outcome signaling proposed | Merged protection, exactly-once, durable cross-client idempotency, automatic unknown-outcome recovery | +| [PR #56](https://github.com/Octo-Lex/ChatGPT-Web2API/pull/56) | P: fresh-route/composer/Send-vs-Stop checks proposed | Merged fix or elimination of post-navigation displacement | +| [PR #57](https://github.com/Octo-Lex/ChatGPT-Web2API/pull/57) | P: current aria DOM and R1–R3 candidate; earlier 54c4b09 CI 44747099994 green and operator-reported short REST canary; later 6d1a651 CI 44875975647 failed (22 failed/715 passed on Ubuntu 3.11) | Later-head qualification, all live capabilities, closure of mixed DOM hydration or buffered/final text policy | + +Gaps: current-upstream feature-by-feature live requalification; real early SSE output under current DOM; same-text and mixed-layout transitions; long/multibranch history; safe unknown-send recovery; authenticated remote exposure policy; explicit REST session isolation; reliable actual-model reporting; non-text artifact format. These are evidence gaps, not approved expansion tasks. Image/file upload, broader Work/Research features, API parity and alternative browser engines are not recorded as existing shipped capabilities here. + +## E. Change acceptance + +For each touched ID, attach a before/after contract and evidence (including failures), indicate whether a regression is in product behavior or a changed internal test seam, and run the relevant tests on the candidate head. Use the exact-head CI matrix plus targeted authorized live validation where an upstream boundary changed. No new live account operations were performed in compiling this baseline. A capability may be temporarily reported degraded/unsupported with a precise reason; retirement, scope expansion or changing defaults requires an explicit maintainer decision. Amend this register and the roadmap in the same review when scope changes. diff --git a/docs/ENGINEERING_CHARTER.md b/docs/ENGINEERING_CHARTER.md new file mode 100644 index 00000000..33112820 --- /dev/null +++ b/docs/ENGINEERING_CHARTER.md @@ -0,0 +1,105 @@ +# Engineering Charter — ChatGPT-Web2API + +**Status:** proposed for maintainer review; not yet adopted. 2026-11-21. +**Basis:** [Capability Register](CAPABILITY_REGISTER.md), pinned master 497527dceabfa3f95961e23c291e618c5570f1ac. This charter defines desired behavior, not a claim that every guarantee is already implemented or qualified. + +## 1. Mission and identity + +Provide the broadest practical, supported programmatic access to ChatGPT Web through an authenticated real browser session, using stable and simple REST and MCP interfaces, while preserving the value of the user's existing account, projects, conversations, memory and Custom GPTs. Maximize safe successful work, resilience to upstream changes and ease of operation with the least necessary complexity. + +This remains a stateful, agent-oriented browser bridge, not a replacement for the official OpenAI API, a reimplementation of ChatGPT, or an autonomous account administrator. Respect upstream entitlement, account access, security controls and usage limits. Do not promise exact model instruction-following, unlimited service, full API parity, or provider availability. + +The original proposition (real Chrome/CDP, no separate upstream API key/manual token extraction, straightforward setup, REST/SSE/MCP, conversation continuity, projects, memory, GPTs and account management within authorized scope) is retained. No research or architectural pattern automatically changes this product scope. + +## 2. Protected capabilities + +The Capability Register is the baseline of existing user-visible and operational behavior. It distinguishes implementation from qualification and documents gaps. + +**G00 — Capability non-regression.** Keep existing legitimate capabilities, default usability, public contracts and compatibility unless a deliberate maintainer decision authorizes a migration, temporary limitation or retirement. Improving safety may require replacing an unsafe mechanism, but not casually dropping the capability it served. Preserve tests of user-visible behavior, and retain negative evidence even when replacing obsolete internal fixtures. Where upstream no longer provides a capability, surface the limitation honestly, preserve the contract where possible and record the evidence; never fabricate success. + +The charter sets policy; the register identifies what must be protected; the roadmap sequences approved work. An Architecture Pattern Register (APR), when established, records how and why a pattern is considered/adopted/implemented/verified. Keep these authority boundaries separate. Follow the APR doctrine of explicit promotion, evidence lineage and scoped qualification; no pattern is adopted here merely by naming it. + +## 3. Priority and design rules + +| ID | Principle | Requirement | +|---|---|---| +| G01 | Correct context and ownership | Verify intended account/session, project and conversation route before mutation; ensure the active target and lease are valid. Never operate on a foreign tab or Stop as a Send fallback. | +| G02 | Effect integrity | Do not blindly replay a possibly accepted external mutation. Distinguish dispatch, acceptance, verified result and unknown outcome. At-most-one in a process is not exactly-once or durable idempotency. | +| G03 | Result integrity | Return only the correct turn's content, with accurate terminal state; no silent stale output, truncation, cross-turn mixing or false success. | +| G04 | Safe recovery first | Recover or continue when sufficient trusted evidence exists. Fail closed where safety cannot be established; a missing optional signal alone is not grounds to reject a valid operation. | +| G05 | Proportional guards | Enforce necessary invariants, not universal availability/agreement of every observer. Guard reviews must compare false accept and false reject cases and recovery cost. | +| G06 | Observation is not authority | Separate route and effect proof, progress, completion, result identity, and delivery. Counts, UI controls, URLs and timestamps have limited and distinct evidentiary roles. | +| G07 | Delivery semantics | Distinguish replaceable buffered content from irrevocable emitted text. Preserve actual incremental SSE while allowing canonical corrections before delivery. | +| G08 | Compatibility and drift | Keep existing supported REST/MCP contracts, model-aware wait budgets, legacy/current UI compatibility when feasible, diagnostics, and validated operational controls. | +| G09 | Evidence before expansion | Keep source, tests, exact-head CI, operator-reported runs, reproducible live tests and operational acceptance separate. Negative findings remain visible. | +| G10 | Minimum justified complexity | Stabilize behavior before moving code. Prefer targeted changes and bounded resource use over speculative general frameworks. | + +P0: safety, data integrity, privacy and authorization are non-negotiable. P1: successful legitimate requests, functional breadth, interoperability, recoverability and compatibility are core product outcomes, not expendable optimizations. P2: latency, throughput, additional supported capabilities and maintenance cost. P3: cosmetic refactoring. Priorities guide tradeoffs; they do not authorize feature removal or lower proof requirements for sensitive effects. + +## 4. Operation contract and proportional evidence + +Conceptual lifecycle (not a required new class hierarchy): + +RECEIVED → ROUTE_VERIFIED → COMPOSER_READY → SEND_ATTEMPTED → ACKNOWLEDGED → GENERATING → COMPLETION_CONFIRMED → RESULT_RECONCILED → DELIVERED. + +Record terminal error, timeout, cancellation and unresolved effect where applicable. Capture the request's intended route, lease and correlation before acting; invalidate stale continuation on loss of route authority. Account/profile persistence and a healthy CDP connection do not establish request ownership. Keep REST owner/SSE attacher and owned-session boundaries intact. + +| Boundary | Sufficient evidence / action | What must not justify success | +|---|---|---| +| Before mutation | Valid route and ownership/lease, safe explicit Send target, composer readiness, a viable method to correlate the turn | Old cached route alone, broad submit selector, missing proof treated as zero | +| Acceptance | Captured causal user identity or qualified same-turn observation; classify uncertainty | A dispatched JS event, a cleared editor alone, hydration of prior controls | +| Progress | Scoped DOM semantic text, attributable UI/network state or verified backend evidence | Generic progress on another turn | +| Completion | Anchored terminal result; or an explicitly qualified same-turn fallback with sufficient finality and content evidence | Copy/Stop absence alone, global timestamp recency, a foreign branch | +| Final result | Verified turn/branch identity, reliable content, consistent completion semantics | Latest-by-time selection without correlation; ambiguity; empty response masquerading as success | +| Delivery | Transport-specific commitment and truthful terminal/error state | HTTP 200, partial text, an internal generator ending, or a path/ID alone | + +Evidence is scoped to the invariant it can prove, not assigned an unconditional global ranking. Backend selectors may be wrong or stale; DOM may drift; URL may lag. Contradictions that invalidate ownership or attribution must not be ignored. Transient absence of an auxiliary observer can be recoverable. Independent count vectors fix max-masking, but count growth cannot by itself distinguish hydration of old controls from a new logical turn. Never turn an unobserved count into measured zero. Require a sufficient trusted baseline or qualified alternative; retain fail-closed when neither is available. + +## 5. Text, non-text and transport contract + +- REST non-streaming and accumulated MCP tool results: keep internal observations provisional; when a complete correctly anchored authoritative result is available, deliver it as a whole, not an incompatible DOM prefix plus suffix. Do not substitute an unproven canonical answer. Any implementation must retain existing response fields and MCP progress notification behavior. +- REST SSE: only publish attributable content and preserve genuine incremental delivery; before any emission, replace provisional text freely using a verified result. After emission, append only compatible verified continuations. If the final verified result contradicts previously delivered text, report an explicit stream failure (not stop/success); preserve HTTP/SSE compatibility limitations. Do not claim previous bytes can be retracted. +- UI labels, toolbar text and reasoning chrome are not answer content. Prefer semantic answer containers and scoped fallback; do not strip legitimate content without evidence. +- Keep non-text handling as a capability: distinguish intermediate tool/reasoning nodes from verified terminal non-text, preserve existing retrieval/placeholder semantics until a supported richer contract is designed; never claim an image/file was delivered when only text or metadata was returned. +- Define truth at the bridge boundary as faithful supported representation of ChatGPT's actual result, not enforcement of the prompt's requested wording. Exact sentinel outputs are a test oracle with model-compliance caveats, not a universal product rule. + +## 6. Recoverability and bounded resource policy + +| Effect state | Recovery rule | +|---|---| +| Confirmed not dispatched | Safe read/preflight retry and re-establish route if allowed. | +| Proven rejected / no effect | Retry only within authorization, rate-limit and time budgets. | +| Dispatched, acceptance unknown | Preserve causal correlation; do not replay blindly. Read/reconcile if possible; report unresolved effect and retry semantics honestly when not resolved. | +| Accepted | Recover response/operation status without resending. | +| Verified result | Deliver if attribution is valid; separately recover or invalidate route for future requests. A changed URL is not automatically evidence of a wrong answer, nor permission for further mutation. | +| Cancelled or timed out | Preserve what is known of the effect. Release request-owned resources safely; no unapproved global stop, tab takeover, or replay. | + +Maintain agent-friendly 429/backoff and safe read/reconnect resilience. PR #52 is pending and does not establish durable idempotency. External client retries, process restarts and shared account effects are distinct boundaries. Any plan to change single_send defaults needs explicit operational and compatibility review. + +Use bounded model/phase-aware wait budgets (first content, idle progress, hard deadline), bounded retries/projections/resource ownership, and honest timeout outcomes. Do not shorten useful thinking time or repeatedly poll large histories without evidence. Recovery must not create a new uncontrolled queue, repeated writes or unbounded resource consumption. + +## 7. Session, security and privacy + +Preserve explicit continuation, fresh chat, project scope, convenient session-scoped auto-continue, opt-in parallel tabs and B1 pooled MCP isolation. Distinguish session isolation from account isolation. Retain safe singleton and stdio modes. No implicit cross-client context reuse where independence is required. Respect explicit/default project selection and document capability-specific limitations. + +Keep existing risk-tier gates at discovery AND call time; protect authenticated profile/session credentials and user content. Default loopback; distinguish local API auth, transport access policy, account permissions and tool authorization. Review endpoints that expose prompts, conversation bodies or secrets even when credentials aren't exported. Diagnostics default to minimal necessary, redacted evidence, not raw payloads. Explicit operator authorization for account-affecting live tests, especially destructive tools; no autonomous deletion or foreign generation cancellation. + +## 8. Outcomes and acceptance criteria + +Track metrics by exact head, account entitlement/model class, route and transport. Baseline first; no invented SLO. Targets: zero wrong-turn/cross-session results, silent corruption, duplicate effects and foreign writes in tested scenarios. Improve successful valid-request rate, recovery without resend, false rejection rate, first-token and total P50/P95 latency, backend reads/turn and diagnostic classification. Separate upstream outage/throttle/model behavior from bridge-induced failure. False rejection requires evidence that a safe alternative actually existed; do not classify every timeout as preventable. + +Every behavioral PR must document: +1. Changed capability IDs and guard/invariant IDs, affected endpoints/modes and migration impact. +2. Before/after expected behavior and evidence for each new or tightened guard; counterexample for false accept, false reject and safe recovery, including cancellation and mixed UI where relevant. +3. Preservation of existing functional tests or explicit rationale for changed fixtures/assertions. A stale mock is not a reason to weaken production; a new guard is not a reason to erase a valid contract test. +4. Own first-pass review and frozen findings before independent reviewer; exact-head CI and review disposition. New head invalidates prior-head claims unless genuinely unchanged scope is separately justified. +5. Targeted, operator-authorized live validation where upstream boundaries change. Include correct turn and text, no duplicate send/foreign mutation, negative cases where safe, progress/finality, and capability parity. Record head, conditions, result and limitations. Do not silently equate CI with production qualification. +6. Bounded rollback/recovery plan, release limitations and open risks. Do not label ready/merge on red CI or unresolved blockers; no forced merges. + +A guard-proportionality review evaluates both safety and legitimate availability. A successful change must preserve the required capability and invariant with the simplest sufficient proof. + +## 9. Non-goals and evolution + +No full OpenAI API emulation, guaranteed model obedience or unlimited upstream capacity. No compulsory backend rewrite, new browser engine, full artifact service, speculative pattern adoption, or feature retirement in the name of architecture. Research may expand knowledge but not committed scope. New capabilities enter the register and roadmap after explicit scope/forcing-function decision and implementation/verification; no undocumented authority creep. + +This charter proposal changes no production code, settings or release defaults. It becomes normative only by maintainer adoption; existing contracts and roadmaps remain in force until that decision. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 89aee474..a79de20d 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -502,3 +502,32 @@ This version removes the stale health work, avoids duplicate rate-limit work, drops the under-specified stdio-process warning, moves `ensure` earlier (`/health` is trustworthy), and pins the two Phase 3 ambiguities (degraded restart, SSE watchdog) before any `ensure` code is written. + +--- + +## Proposed Phase 8 entry gate — capability preservation and guard proportionality (2026-11-21) + +**Proposal only:** pending maintainer adoption of [Engineering Charter](ENGINEERING_CHARTER.md) and [Capability Register](CAPABILITY_REGISTER.md). This section does not approve new implementation scope, alter earlier shipped milestones, or authorize merging any open PR. The earlier roadmap remains the sequencing authority until the proposal is adopted. + +### Baseline correction + +Master at 497527d includes A1/A2 (#38–39), B1 (#42, default-off MCP session-affine pool), and the #44 reliability session. These are existing capabilities, not work to restart. B1's structural canary is scoped; full account-burst qualification remains open. The README's pre-B1 warning remains valid for the unpooled path but no longer describes all available code. Record that documentation drift rather than assuming absence of B1. Master CI run 29195499536 had all six test jobs passing but lint failed and build was skipped. Do not label it all-green. + +### Proposed near-term sequence + +| Stage | Work and decision gate | +|---|---| +| 8.0a — Baseline and charter | Review the two governance documents against pinned master; confirm preserved capabilities, scope, constraints and evidence axes. Amend deliberately; no production code in this documentation PR. | +| 8.0b — Guard proportionality | Audit current production and pending guard policies against G00–G10. Classify each as necessary invariant, recovery mechanism, auxiliary observation or unnecessary coupling. Record false-accept/false-reject scenarios; keep identity/ownership/no-blind-replay guarantees. | +| 8.1 — Restore current chat path (#57, companion replacement for #55) | Review R1, R2, R3, text finality and all 22 failures at 6d1a651. Distinguish obsolete fixtures from valid behavioral contracts; handle mixed hydration (logical identity, not just counts), non-text versus UI chrome, and buffered REST/MCP versus emitted SSE. Preserve true incremental output, thinking budgets and qualified fallbacks. Keep scope narrow; split delivery-policy work only if necessary and explicitly agreed. | +| 8.1 gate | Freeze first-pass review, independent review, exact-head CI/build, then targeted authorized live qualification of changed paths. The 54c4b09 short REST canary is not a certificate for 6d1a651 or SSE. Do not merge both #55 and its companion #57. | +| 8.2 — Mutation outcome (#52 / #51) | Reconcile no-replay semantics on the accepted combined head; review unknown-outcome handling and client retries. Decide single_send default explicitly, after preserving safe retry functionality. Do not claim durable idempotency/exactly-once. | +| 8.3 — Navigation and Send safety (#56) | Rebase with combined selector and no-replay changes; retain F2 finally rebinding requirement, fresh route/project validation and no Stop/foreign-tab mutation. Review displacement after navigation. | +| 8.4 — Combined qualification | Verify route → send → acknowledgment → completion → delivery with exact-head CI, independent review and authorized scoped live evidence. Sequence of #57/#52/#56 above is proposed, not permission to deploy a known unsafe intermediate configuration. If a dependency or blocker requires a different order, amend this roadmap before proceeding. | +| 8.5 — Further evolution, candidate only | Consider request-state/recovery coordination, delivery policy extraction, session-contract parity, observability and measured resource/latency improvements. Admit a separate work item only for a demonstrated gap with a forcing function. Preserve scope, no speculative rewrite. | + +### Acceptance and non-regression + +Use the capability IDs in the register for changed behavior; retain tests exercising established user-visible contracts. Evidence for actual upstream compatibility must be distinguished from exact-head CI and historical canaries. Prioritize a high valid-request success rate without wrong-turn, foreign-write, duplicate-effect or silent-corruption outcomes. Measure false rejection with evidence of a viable safe alternative. No new numerical SLO until baseline measurement. + +No broader feature expansion, alternate browser backend, APR pattern adoption, or public API retirement is approved by this proposal. Existing `ensure` semantics, owner/attacher architecture, risk-tier gates, B1 opt-in behavior, 16 MCP tools and normal REST/SSE contracts remain protected. See the charter for the change acceptance checklist.