Repository navigation
Complete Excel Agent 0.5 private-beta hardening and vNext foundations - #37
Draft
itscharles175 wants to merge 7 commits into
Draft
itscharles175 wants to merge 7 commits into
itscharles175 wants to merge 7 commits into
Conversation
Trust correctness foundations - workbook-worker: silent OOXML regen fallback now requires explicit consent; .xlsm fallback gated behind allowMacroRegeneratedFallback; fallbackTriggered surfaced on fidelity/trust report. - backend: plan state machine enforces draft -> approved -> applied paths and V3 lifecycle transitions; illegal transitions return 409 instead of silently back-dating plans. - backend: require_apply_eligibility is now server-authoritative via BRAIN_APPLY_ELIGIBILITY_MANDATORY env; clients can only ratchet up. - backend: workbook_snapshots gain state_hash column (migration 0014) so rollback can detect tampering via state_verified. - backend: apply-token consumption + dedupe — open attempts coalesce on retry, completed tokens reject reuse with apply_token_consumed. - backend: plan approval refuses non-atomic batches (multiple ops on same sheet+range) before snapshot/audit. Security and injection - backend: new cell_value_safety.sanitize_literal + is_potential_formula; write_cell validator warns on formula-trigger values; source_evidence sanitizes extracted labels. - backend: ZIP-bomb hardening for .xlsx/.xlsm uploads — entry-count, total uncompressed size, compression ratio, path-traversal and absolute-path rejection. - backend: WS API key accepted via Authorization header or sec-websocket-protocol; query-string fallback logs a deprecation warning. - backend: CORS allow_methods + allow_headers explicitly pinned. - backend: STATIC_KEY_ADMIN_ENABLED default flipped to false. - backend: macro detection prefers ooxml.vba_project_present over extension sniffing (spoof-resistant). OOXML fidelity - worker: contentTypeIntegrity flags vbaProject.bin + non-macro workbook override and missing application/vnd.ms-office.vbaProject default/override. - worker: trustReport now exposes ooxml.fallbackTriggered. Sync engine reliability - plugin: stableQueueHash upgraded to 64-bit FNV-1a (16 hex, ~4B collision boundary). - plugin: SYNC_MAX_ATTEMPTS + jittered exponential backoff helper; classifySyncFailure distinguishes terminal vs transient. - plugin: sync-replay keeps transient failures pending for retry inside the attempts budget; only terminal or budget-exhausted failures mark failed. Patch + storage durability - plugin: appendSyncJournal dedupes by (idempotencyKey, kind, status, revision); WorkbookStorageQuotaError surfaces remaining bytes from navigator.storage.estimate. Calculation parity - plugin: calc-worker registers workbook-scope named ranges via addNamedExpression, counts and warns on volatile functions, reports namedRangesRegistered + volatileFormulaCount + warnings. AI pipeline correctness and cost - backend: REACT_STEP_TOKEN_BUDGET and REACT_TOTAL_TOKEN_BUDGET env-tunable budgets; ReActTrace records token totals and aborts with REFLECT when total budget is exceeded. Backend hardening - backend: WorkbookIngestion/Export/Diff synchronous calls now wrapped in asyncio.wait_for(asyncio.to_thread(...), timeout) with HTTP 504 on timeout. - backend: rate limiter prunes stale buckets every 60s. Frontend polish - plugin: per-endpoint timeouts (5s/health, 60s/spreadsheet, 120s/plan-simulation-experiments); built-in exponential-with-jitter retry for idempotent GETs on 408/429/502/503/504/network/timeout; honors Retry-After. Tests + release evidence - pyproject.toml adds unit/integration/contract/security pytest markers. - New scripts/check_version_sync.py enforces VERSION across manifest.xml, package.json, backend/config.py. - New backend tests: test_plan_state_machine (12), test_snapshot_integrity (4 incl. tamper detection). - New worker test: OOXML preserve fallback for macro workbooks requires explicit consent. Verification: 216/216 backend tests, 32/32 worker tests, 37/37 plugin vitest, 11/11 plugin office-mock pass; typecheck + lint clean; OpenAPI types in sync; VERSION sync clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
[skip ci] Verified locally; do not consume or depend on GitHub-hosted Actions minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
This draft completes the repository-side private-beta hardening program and lands the experimental vNext clean-break foundations at commit
c540dce80144b3b1d7ef7f17a9217580c9a9363d.The supported 0.5 path now has stronger review/apply/recovery controls, bounded worker admission, encrypted storage and migration tooling, sparse local-first spreadsheet hydration, accessible history/recovery UX, and a fail-closed local release plane. vNext adds frozen contracts, portable domain cores, an exact-proof OPC/XLSX slice, transport-neutral SDKs, and a native local persistence host—without claiming a deployed service.
How it looks
Root cause and trust boundary
The prior branch had strong feature breadth but incomplete cross-cutting authority, recovery, lifecycle, evidence, and offline-verification boundaries. This change makes those boundaries explicit and fail closed:
Scope
What landed
Risk and compatibility
c540dcecan be reverted to branch SHAd3b4fda; additive schemas and opt-in experimental stores remain dormant unless explicitly constructed. A scoped forward fix is preferred once data has been created under a new additive schema.Evidence
All commands ran locally or in local Docker/self-hosted-compatible environments; no GitHub-hosted runner was used.
--network none, Cargo offline, read-only source/vendor mountsnetwork=false), and npm audit passedGenuine external blockers
The strict release prerequisite command intentionally remains red with six blocker groups:
Target-topology PostgreSQL/OIDC/mTLS, real Windows/Mac/Web host execution, independent reviewer/witness approvals, signing/key custody, licensing/legal approval, and production deployment evidence are not fabricated by this PR.
Release posture
self-hostedlabels, and all 26 external action refs are pinned to full 40-character SHAs.