Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 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
7b38b63
Merge current main into Figma REST fallback
seonghobae Aug 31, 2026
4eb9b5a
fix(ci): make bootstrap contract pipe-safe
seonghobae Aug 31, 2026
b159854
fix(figma): harden direct file reader
seonghobae Aug 31, 2026
d2da380
fix(noema): isolate cancelled follow-up runs
seonghobae Aug 31, 2026
dd305b1
docs(noema): clarify cancelled-run isolation
seonghobae Aug 31, 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
4 changes: 4 additions & 0 deletions .github/workflows/noema-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ concurrency:
noema-review-${{
github.event.pull_request.base.repo.full_name ||
github.event.client_payload.target_repository || github.repository }}-${{
github.event_name == 'workflow_run'
&& github.event.workflow_run.conclusion == 'cancelled'
&& github.run_id
||
Comment thread
seonghobae marked this conversation as resolved.
github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number ||
github.event.client_payload.pr_number ||
github.run_id }}
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ directive is not trust evidence. See
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).
Organization edge runtimes use Cloudflare Pingora. Do not add or preserve active Nginx containers, packages, commands, service/config files, or Kubernetes Nginx ingress annotations/classes. Read [`docs/policies/PINGORA_EDGE_POLICY.md`](docs/policies/PINGORA_EDGE_POLICY.md) and ADR-0019 before changing HTTP edge, static-serving, ingress, TLS, or proxy deployment behavior.

Semgrep hosted scans bind one job-level `SEMGREP_IMAGE` digest for log evidence, manifest inspection, and `docker run`. See [`docs/doctoring/semgrep-image-digest-single-source.md`](docs/doctoring/semgrep-image-digest-single-source.md).
Expand Down
32 changes: 32 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,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 Down Expand Up @@ -179,6 +209,8 @@ resolver conflict.
— import-only exact source dependencies for networkless coverage.
- [`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.
- [`docs/doctoring/sandboxed-web-readiness-loopback-boundary.md`](docs/doctoring/sandboxed-web-readiness-loopback-boundary.md)
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,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 @@ -862,6 +864,8 @@ Semantic Versioning where the repository publishes a release.

- Fail closed when GitHub dependency-review evidence is unavailable (non-200, transport failure, or truncated compare) instead of treating HTTP 403/404 as a clean skip; the probe checks out the exact head SHA and never prints the API body.
- 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.
- Accept both current dot-region and legacy hyphen-region Figma S3 image hosts while retaining the Figma bucket prefix and `amazonaws.com` suffix allowlist, track Figma's live unauthenticated `/v1/me` response change from HTTP 403 `Invalid token` to HTTP 401 `Missing credentials`, keep the documented file-reader CLI importable from any working directory, and reject Figma credential markers case-insensitively from generated labels.
- 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 @@ -879,6 +883,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 @@ -152,3 +152,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 @@ -130,6 +130,7 @@ GitHub **Project #1** is the shared source of truth. Structure: real **Issues**
- Renames done (keyverse/wardnet/inkspan). Planning spec = ContextualWisdomLab/naruon#974. Protocol = ContextualWisdomLab/.github#363. Project #1 remains the live tracker; naruon Phase 0 issue ContextualWisdomLab/naruon#975 is Done (closed completed 2026-07-13). Next ordered phase is ContextualWisdomLab/naruon#976 (P1 Plugin SDK); execute one phase at a time.
- GitHub Actions hosted Checks are running on current ContextualWisdomLab/.github PRs. Remaining merge blockers are missing current-head OpenCode approvals, Strix provider fail-closed, unresolved threads, and DIRTY/CONFLICTING stacks — not a total runner outage. Do not treat the earlier spending-cap halt as live unless Project #1 still shows it.
- **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.
- **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`.
- Historical July 2026 delivery that is already merged lives on Project #1 as Done (ContextualWisdomLab/.github#363/#362/#361, ContextualWisdomLab/naruon#974/#973/#965, and sibling fuzz/SBOM PRs). Human leftovers remain: report the mapasevo21 malware file (github user-attachments) to GitHub Abuse; rotate the xtrmLLMBatchPython-leaked keys; D1/D2 above.

---
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