跳到主要內容

Sample contract · AUP cross-device · ARC 2.0.0-beta.28

`action` primitive

Declare a button or navigation action without promising exec on the document target.

action is an AUP cross-device primitive, not a Web Device layout component and not a Web-only widget. It is one of the 18 names in AUP_PRIMITIVES and appears in every target's DeviceCaps.primitives map as native, webview, partial, or unsupported.

Contract

FieldValue
Primitive nameaction
LayerAUP cross-device primitive (AUP_PRIMITIVES)
Public statusreleased
Document capabilitynative
Shared degradation chainNone (document reports native)
Author entryAUP tree · Markdown ::action (often inside action-card) · DSL
Document renderer / notesrenderer/primitives/action.ts (safeHref); cards synthesize action nodes
Showcase evidenceform / portal pages; document cards path on markdown unit pages

When to use

You need a labeled operation: navigation href, or (on interactive targets) events.click / exec.

When not to use

On public docs, use navigation-only actions. Do not promise AFS exec or destructive confirmations from a static document sample.

Sample contract

FieldValue
PurposeNavigation-only action on document
BoundariesNo exec, no AFS write, no session
Author entry::action{…}
SurfaceWeb Device document
Public statusreleased
Fallback / failureUnsafe href schemes rejected; missing href → non-link span/button chrome
VerificationRoutes below · arc --version = 2.0.0-beta.28

Document sample (navigation action)

This example places an ordinary navigation href with no event, exec, or data write.

Source:

markdown
::action{label="Open live example contract" href="/en/docs/aup/live-example-contract/" variant="primary"}

Rendered:

Open live example contract

Source:

markdown
::action{label="Label only — not a navigation target" variant="secondary"}

Rendered:

Label only — not a navigation target

Card composition: action-card.

Failure and limits

SituationExpected result
javascript: / data: hrefRejected by safeHref; not a clickable privileged link
Missing hrefNon-link presentation (span / button path without navigation)
Expecting exec or AFS writeOut of contract on static document samples
Nested inside action-cardStill navigation-only unless a separate interactive runtime is proven

Verification evidence

ItemValue
Baseline2026-08-09 · arc --version → 2.0.0-beta.28
Capability rowdocs/aup/capability-matrix.md (internal, non-routed) · action
Implementationcontent-reader.ts (generic ::action); renderer/primitives/action.ts (safeHref)
Public routes/en/docs/aup/primitives/action/ · /zh/docs/aup/primitives/action/
Local runarc service start --blocklet blocklets/arcblock --port 4900 · click navigation action → ordinary navigation only
AcceptPrimary action navigates; label-only action is not a privileged write; no exec

Evidence anchors

ItemValue
Registrypackages/aup/src/aup-types.ts · AUP_PRIMITIVES
Document capsproviders/runtime/web-device/src/device-caps.ts · DEVICE_CAPS_DOCUMENT
Degradationpackages/aup/src/degradation.ts · DEGRADATION_CHAINS
Internal matrixdocs/aup/capability-matrix.md (internal, non-routed)
Taxonomy hubPrimitive taxonomy and evidence
Sample contract rulesLive examples: scope and contract

Nearby pages