Skip to content

fix: protect local editor request and update boundaries - #45

Merged
ts-76 merged 11 commits into
mainfrom
fix/editor-request-boundaries-42
Oct 3, 2026
Merged

ts-76 merged 11 commits into
mainfrom
fix/editor-request-boundaries-42

Conversation

@ts-76

@ts-76 ts-76 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Protect local editor request and update boundaries: restrict mutation requests to the same local origin, validate JSON/content type/body size, serialize config changes with an exclusive file lease, and report Apply progress and partial failures accurately. Add frame-ancestors/X-Frame-Options protection to responses. Repo proposals use the current draft contract and return edits without saving.

Closes #42. Standalone UI proposal callers use the new API contract. Apply reports the next stage before reloading config. Tests exercise actual HTTP routes, invalid/oversized requests, competing mutations, framing and partial failures. Existing Copilot findings are fixed and resolved.

Based on merged #44 and #39. Automatic tags/npm publication remain disabled. Validation at ac2b4b9f295acbc9caebe388e5ae33122f65f6f9: frozen root/UI installs, lint, root/UI TypeScript, 103 CLI/API/release tests, full CLI/UI build and real tarball checks pass. The final merge of landed #44 changed commit ancestry only; its source tree is identical to the tested tree. Root Bun/UI Bun/root npm audits are all 0. Exact-head CI37118590473 and Security37118590474 (audit + CodeQL) both succeed. Fresh Copilot review remains unavailable from the earlier quota exhaustion.

@ts-76
ts-76 marked this pull request as ready for review October 3, 2026 09:31
Copilot AI balanced review requested due to automatic review settings October 3, 2026 09:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Repo-add UI actions are broken by the new API contract, framing remains exploitable, and one failure path reports contradictory progress.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Strengthens the local editor’s HTTP, filesystem, concurrency, and Apply-reporting boundaries.

Changes:

  • Adds loopback, Host/Origin, JSON, size, and static-path validation.
  • Serializes Save/Apply operations with cross-process leases.
  • Adds sanitized Apply progress reporting and regression tests.
File Description
src/​commands/​edit.ts Secures editor requests, updates, and assets.
src/​commands/​apply.ts Tracks Apply stages and failures.
src/​commands/​apply-progress.ts Defines progress types and errors.
src/​commands/​sync.ts Reports synchronization stages.
src/​cli/​main.ts Documents allowed loopback hosts.
test/​edit-server.test.ts Adds editor security regressions.
test/​command-boundaries.test.ts Updates Apply workflow expectations.
README.md Documents editor safeguards and recovery.
docs/​README.ja.md Adds Japanese safeguard documentation.
skills/​ghq-sector-cli/​SKILL.md Updates the editor command example.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/commands/edit.ts
Comment thread src/commands/sync.ts
@ts-76
ts-76 requested a balanced review from Copilot October 3, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ts-76
ts-76 changed the base branch from fix/sync-path-protection-40 to main October 3, 2026 11:06
@ts-76
ts-76 merged commit b500c2d into main Oct 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

編集APIのリクエスト境界・入力検証・同時実行を保護する

2 participants