Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
93aaf69
fix(agents): document Cloud Agent Figma MCP auth fallback
cursoragent Aug 16, 2026
5faec22
fix(ci): pin Figma whoami to HTTPSConnection
cursoragent Aug 16, 2026
91feb91
fix(agents): add Cloud Agent Figma REST file read
cursoragent Aug 16, 2026
3963310
fix(ci): cap Figma REST bodies and refuse Host overrides
cursoragent Aug 16, 2026
1b6474b
fix(agents): keep Figma REST design fields and branch keys
cursoragent Aug 16, 2026
93e9a46
fix(figma): retain style references and component sets
seonghobae Aug 19, 2026
46911c5
fix(security): annotate fixed Figma TLS sinks
seonghobae Aug 19, 2026
f864176
docs: record Figma file identity decision
seonghobae Aug 20, 2026
38fbf9f
Merge branch 'main' of https://github.com/ContextualWisdomLab/.github…
seonghobae Aug 20, 2026
83759d9
test(figma): document nested transport fixtures
seonghobae Aug 20, 2026
54cb022
Merge branch 'main' into codex/pr1043-current-main-successor
seonghobae Aug 20, 2026
ef5183e
Merge origin/main into Figma REST successor
seonghobae Aug 21, 2026
f64bf3f
Merge protected main into Figma REST successor
seonghobae Aug 21, 2026
0fd89fe
Merge branch 'codex/pr1043-current-main-successor' of https://github.…
seonghobae Aug 21, 2026
f661a8e
docs(figma): remove duplicated security notes
seonghobae Aug 21, 2026
fb24399
Merge branch 'main' into codex/pr1043-current-main-successor
opencode-agent[bot] Aug 21, 2026
6cbe960
fix(figma): preserve node catalogs and explicit TLS
seonghobae Aug 21, 2026
8ffdf4d
fix(security): audit Figma TLS sinks and pip lock
seonghobae Aug 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (
Conflict-scope roots fail closed when the immediate parent directory is a symbolic link.
OriginWeave hourly NVIDIA NIM repair is a thin caller at minute 10. See [`docs/doctoring/originweave-hourly-review-caller.md`](docs/doctoring/originweave-hourly-review-caller.md).
nonnest2 hourly NVIDIA NIM repair is a thin caller at minute 16. See [`docs/doctoring/nonnest2-hourly-review-caller.md`](docs/doctoring/nonnest2-hourly-review-caller.md).
Cursor Cloud Agents cannot complete Figma MCP OAuth against `https://mcp.figma.com/mcp` (allowlisted-client catalog; Cloud unsupported). Desktop/CLI remain the MCP path. Cloud Agents that must read Figma files store `FIGMA_ACCESS_TOKEN`, run `python3 scripts/ci/figma_rest_auth.py`, then `python3 scripts/ci/figma_rest_file.py <file-key-or-url>`. See [`docs/doctoring/figma-cloud-agent-mcp-auth.md`](docs/doctoring/figma-cloud-agent-mcp-auth.md).
The materialization contract is also covered by [`docs/doctoring/exact-artifact-sbom-attestation.md`](docs/doctoring/exact-artifact-sbom-attestation.md).
32 changes: 32 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,36 @@ sequenceDiagram
- Downloaded SBOM and distribution bytes are inert. The signing job does
not import, install, or unpack them.

## Figma Cloud Agent REST fallback

```mermaid
flowchart TD
Need["Cloud Agent needs Figma"]
Mcp{"Figma MCP OAuth available?"}
Desktop["Desktop / CLI: Settings → Tools and MCP → Figma → Connect"]
Token{"FIGMA_ACCESS_TOKEN set?"}
Whoami["python3 scripts/ci/figma_rest_auth.py"]
File["python3 scripts/ci/figma_rest_file.py file-key-or-url"]
Mint["Mint a Figma PAT with file_content:read and store the secret"]

Need --> Mcp
Mcp -->|"yes, Desktop or CLI"| Desktop
Mcp -->|"no, Cloud or Automation"| Token
Token -->|"no"| Mint
Mint --> Whoami
Token -->|"yes"| Whoami
Whoami --> File
```

Cloud Agents never complete Figma MCP OAuth. Whoami alone is not file
read. The file helper allowlists the file or branch key and node ids,
opens a pinned `HTTPSConnection("api.figma.com")`, and prints a
token-free JSON outline with geometry, solid fills, text, auto-layout,
component sets, style metadata, and node style references. `--images` returns
expiring PNG URLs. Desktop/CLI Figma
MCP remains the `get_design_context` path. See
[`docs/doctoring/figma-cloud-agent-mcp-auth.md`](docs/doctoring/figma-cloud-agent-mcp-auth.md).

## Quality gates

`scripts/ci/` ships with 100% statement/branch coverage and 100% docstrings.
Expand All @@ -147,5 +177,7 @@ trusted `uv` exporter is downloaded from the literal GitHub Releases URL for
— current increment's repair-worker decision and APA 7th citations.
- [`docs/doctoring/fast-mlsirm-hourly-review-caller.md`](docs/doctoring/fast-mlsirm-hourly-review-caller.md)
— product-specific psychometric repair heartbeat and scientific gates.
- [`docs/doctoring/figma-cloud-agent-mcp-auth.md`](docs/doctoring/figma-cloud-agent-mcp-auth.md)
— Cloud Agent Figma MCP boundary and REST file-read fallback.
- [`docs/doctoring/exact-artifact-sbom-attestation.md`](docs/doctoring/exact-artifact-sbom-attestation.md)
— current increment's attestation decision and APA 7th citations.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Semantic Versioning where the repository publishes a release.
- Added an hourly organization commercial-readiness coordinator that discovers writable repositories, honors enabled dedicated writer leases and fully paginated live writer runs, refetches exact repository/workflow/run/PR state before dispatch, rotates bounded review-repair and opt-in NVIDIA OpenCode product-development targets, fails nonzero on fleet-wide inspection or dispatch outages, retains three-day JSON receipts, and keeps the existing 15-minute merge scheduler authoritative.
- Added a dedicated Quarantine Sandbox Runtime hourly caller at minute 14 that targets protected `develop`, dispatches at most one exact-head repair, applies a two-hour same-head retry floor, preserves non-cancelling single-flight execution, and maps only the established scheduler credentials with job-scoped OIDC.
- Added a dedicated OriginWeave hourly caller that invokes the product-neutral central scheduler with the exact repository, protected `main` branch, one-dispatch budget, two-hour same-head retry floor, non-cancelling single-flight heartbeat, job-scoped OIDC, and only the established scheduler credentials.
- Added Cloud Agent Figma REST helpers `scripts/ci/figma_rest_auth.py` and `scripts/ci/figma_rest_file.py` that verify `FIGMA_ACCESS_TOKEN` against pinned `GET /v1/me` and then read an allowlisted `GET /v1/files/{file_key}` (optional `/nodes` or `/images`) without printing the secret, returning geometry, solid fills, text, auto-layout, component sets, style metadata, node style references, and optional expiring PNG URLs. Desktop/CLI Figma MCP remains the `get_design_context` path.
- Added ADR 0013 with the explicit Figma File ID decision for the Cloud-Agent REST-only infrastructure boundary.
- Added a trusted pull-request comment router for `@cwl-noema-review` and review-only `@opencode-agent` dispatches, with an organization sweep, exact-head receipts, repository allowlisting, fixed runners, immutable checkout pins, and a permanent 100% statement/branch/docstring quality gate.
- Added an organization-owned reusable exact-artifact SBOM attestation boundary that validates inert six-file wheel/sdist evidence, binds CycloneDX 1.7 predicates to exact SHA-256 subjects, signs through least-privilege GitHub artifact attestations, and exports online and offline verification bundles.
- Added exact-base `uv.lock` materialization that reconstructs standalone nested projects with a checksum-pinned official `uv` exporter, isolated frozen/offline execution, strict exact-pin and SHA-256 output validation, and complete Python 3.10/3.14 quality evidence.
Expand Down Expand Up @@ -56,6 +58,7 @@ Semantic Versioning where the repository publishes a release.
### Security

- Keep the Quarantine Sandbox Runtime caller read-only and model-secret-free, grant only job-scoped OIDC to the reusable scheduler, and preserve the product boundary in which the sandbox returns artifact-analysis evidence while hosts retain WAF/IDS, admission, final verdict, incident, and retention authority.
- Pin Figma REST calls to `http.client.HTTPSConnection("api.figma.com")`, allow only the `X-Figma-Token` header, allowlist file keys and node ids (CWE-22), parse locators without fetching them (CWE-918), reject control characters in the token (CWE-113), and cap whoami/file bodies so `file://` and unbounded reads cannot leave the helper.
- Reject `.github/` and `scripts/ci/` from review-thread-derived autofix path authority so an untrusted inline reviewer cannot authorize the write-capable repair agent to modify workflows, CODEOWNERS, actions, scheduler code, or CI helpers that govern its own control plane.
- Require the model-write snapshot and exact-path allowlist to remain outside the pull-request worktree, checking both absolute and resolved locations so repository-local controls and outside-looking symlinks resolving into the repository fail closed before they can authorize or verify model changes.
- Snapshot the complete pre-model worktree for ordinary and conflict repair and reject every model-caused created, deleted, modified, mode-changed, retargeted, ignored, dangling, directory-backed, external-link, metadata-race, or out-of-scope path before staging or push.
Expand All @@ -73,6 +76,7 @@ Semantic Versioning where the repository publishes a release.
### Documentation

- Added Quarantine Sandbox Runtime operator and APA 7 doctoring for the hourly RCA loop, source-agnostic leaf boundary, protected-`develop` activation, bounded retry cadence, OIDC and secret scope, independent approval, verification, and rollback.
- Added an APA 7 doctoring record for the Cloud Agent Figma MCP OAuth boundary, REST whoami and file-read helpers, operator next-action contract, and Figma file-endpoint citations.
- Rewrote the root README for org operators and sibling-repo maintainers: org profile plus central required workflows, standalone run, and how siblings consume ruleset `18156473` without copying workflow files. Moved bot/agent PR-review procedure to `docs/pr-review-and-merge-procedure.md`.
- Retargeted the Strix quality-gate prose contract to the review procedure document.
- Added an APA 7 doctoring record for conflict-control evidence isolation, including the Strix-reported trust-boundary failure, test-first remediation, canonical-path rule, operator contract, rollback, MITRE CWE-22, and current GitHub Actions secure-use guidance.
Expand Down
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,8 @@ repeatable compile command.
cross-repo references as `owner/repo#num` or full URLs; durable knowledge in the repo/Project, not
private memory; one roadmap phase at a time) are defined in `docs/CWL-MASTER-CONTEXT.md` §7 and
apply here.
- **Figma on Cloud Agents is REST-only.** Do not retry MCP Connect against
`https://mcp.figma.com/mcp`. Store `FIGMA_ACCESS_TOKEN`, run
`python3 scripts/ci/figma_rest_auth.py`, then
`python3 scripts/ci/figma_rest_file.py <file-key-or-url>`. Desktop/CLI keep
the full MCP path. See `docs/doctoring/figma-cloud-agent-mcp-auth.md`.
1 change: 1 addition & 0 deletions docs/CWL-MASTER-CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ GitHub **Project #1** is the shared source of truth. Structure: real **Issues**
- **BLOCKER B1**: org GitHub Actions effectively HALTED (~86 queued, ~0 in_progress org-wide) — likely the Actions monthly SPENDING CAP. Blocks ALL PR checks/merges + the Cloudflare DNS run (nameservers). Fix (org-admin): raise the Actions spending limit OR add a self-hosted runner. Nothing merges until then.
- **Decisions pending**: (D1) Code Security enablement vs the CodeQL-only code_scanning ruleset (osv/trivy/scorecard SARIF upload) — a private repo needs GHAS seats; reconcile or make those checks non-required. (D2) trivy `limit-severities-for-sarif: true` (gate only CRITICAL/HIGH) — held pending the user's strict-security preference.
- **Built this session, PR-open, awaiting merge (B1)**: see Project #1 PRs (contextual-orchestrator cost/routing #46 + naruon#973; pg-llm-batch; keyverse Keycloak; inkspan; SBOM #361; opencode auto-retry #360; Strix neutral #349 + emit #358; appguardrail collector #254; auto-rebase #357; noema #359/naruon#970; PDF-DOM naruon#965/newsdom#300; SDP #11; fast-mlsirm GPGPU #109; scopeweave #284/naruon#971; fuzzing 10 PRs (found+fixed 2 real naruon bugs); Cloudflare DNS/Pages #362; this protocol #363; planning #974). Human step: report the mapasevo21 malware file (github user-attachments) to GitHub Abuse; rotate the xtrmLLMBatchPython-leaked keys; the org-admin runner/decisions above.
- **Figma MCP on Cloud Agents (2026-08-16)**: `https://mcp.figma.com/mcp` is OAuth-only and not supported in Cursor Cloud Agents / Automations. Desktop IDE and CLI remain the MCP path. Cloud Agents that must read Figma files store `FIGMA_ACCESS_TOKEN`, run `python3 scripts/ci/figma_rest_auth.py`, then `python3 scripts/ci/figma_rest_file.py <file-key-or-url>` against the REST API. See `docs/doctoring/figma-cloud-agent-mcp-auth.md`.

---
*Keep this current. Update Project #1 as the live tracker; this file is the narrative brief a fresh agent reads to reconstruct the whole picture.*
Expand Down
41 changes: 41 additions & 0 deletions docs/adr/0013-figma-cloud-agent-rest-fallback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ADR 0013: Figma Cloud-Agent REST fallback

- Status: Accepted
- Date: 2026-08-20
- Owners: ContextualWisdomLab `.github` automation
- Figma File ID: N/A — this repository change is a security and API
integration helper, not a user-facing canvas or component design.

## Context

The Figma MCP OAuth flow is available to supported desktop and CLI clients,
but a Cloud Agent cannot complete that client registration. The automation
still needs a bounded way to inspect a buyer-supplied Figma file without
printing credentials or accepting an arbitrary URL.

## Decision

Keep desktop and CLI agents on Figma MCP. Cloud Agents use
`FIGMA_ACCESS_TOKEN` with the repository's pinned REST helpers. The helpers
pin the Figma HTTPS origin, allowlist file and node identifiers, cap response
bodies, and emit token-free outlines. No design artifact is introduced by
this infrastructure PR, which is why the Figma File ID is explicitly N/A.

## Verification and rollback

Run `pytest -q tests/test_figma_rest_auth.py tests/test_figma_rest_file.py`.
Rollback by reverting the helper and its caller documentation; desktop/CLI
MCP remains independent.

## APA 7th references

Figma. (2026). *File endpoints*. Figma Developer Docs. Retrieved August 20,
2026, from https://developers.figma.com/docs/rest-api/file-endpoints/

Figma. (2026). *Set up the remote server*. Figma Developer Docs. Retrieved
August 20, 2026, from
https://developers.figma.com/docs/figma-mcp-server/remote-server-installation/

Fielding, R., Nottingham, M., & Reschke, J. (Eds.). (2022). *HTTP semantics*
(RFC 9110). Internet Engineering Task Force.
https://www.rfc-editor.org/rfc/rfc9110
Loading
Loading