Skip to content

fix(examples): migrate SafeDOMExample.affine to current AffineScript grammar (closes #208)#210

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/safedom-canonical-148-208
May 26, 2026
Merged

fix(examples): migrate SafeDOMExample.affine to current AffineScript grammar (closes #208)#210
hyperpolymath merged 1 commit into
mainfrom
claude/safedom-canonical-148-208

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Replaces the 3 byte-identical pre-stabilization-dialect copies of SafeDOMExample.affine in this repo with a single canonical that parses on current AffineScript syntax. The previous content pre-dated ADR-014 (qualified paths), ADR-016 (effect rows), and the #{-record-literal sigil (ADR-215), and parse-failed at line 1 of affinescript check everywhere it lived.

Closes #208.

What changed (per affected file — all 3 are byte-identical)

  • module SafeDOMExample; header (ADR-011)
  • use prelude::{...} (ADR-014)
  • enum X { A(T), B(U) } (was type X = A | B)
  • struct Y { f: T } for records (was type Y = { f: T })
  • X #{ f: v } record literals (ADR-215 #{-sigil)
  • Callbacks passed as separate fn(...) -> () parameters rather than struct fields (fn-typed struct fields are not currently parser-supported)
  • Console::log/Console::error (was IO.println/IO.eprintln)
  • Err(...) constructor (was Error(...))
  • -{IO}-> effect arrow (was -> () / IO)

Validation

affinescript check on each file reports Resolution error: (Resolve.UndefinedModule SafeDOM) — the parser layer succeeds. The SafeDOM stdlib targeted by the example is the subject of affinescript#56 (DOM+Pixi binding survey) and is intentionally not yet implemented. This matches the gitbot-fleet#148 sustainabot validation oracle exactly: parse passes, cross-module resolution is INT-02 territory.

Estate sweep context (5 PRs total, all from session 2026-05-26)

  • this PR (gitbot-fleet, 3 fixtures) — migrate
  • burble (1 fixture) — migrate (separate PR)
  • claude-gecko-browser-extension (1 fixture) — migrate (separate PR)
  • standards (24 fixtures) — delete (over-propagated vendored copies; canonical lives here)
  • standards-as-port (24 fixtures) — delete (port-staging shadow of standards/)

Test plan

  • affinescript check on all 3 files: Resolution-level only (no parse errors)
  • Canonical SPDX header: MPL-2.0
  • All 3 files byte-identical after edit (sweep symmetry preserved)

🤖 Generated with Claude Code

…grammar (closes #208)

Replaces the 3 byte-identical pre-stabilization-dialect copies of
SafeDOMExample.affine in this repo with a single canonical version
that parses on current AffineScript syntax. The previous content
pre-dated ADR-014 (qualified paths), ADR-016 (effect rows), and the
`#{`-record-literal sigil (ADR-215), and parse-failed at
`use SafeDOM` (missing semicolon) on every `affinescript check`
invocation in the estate.

Affected paths (all byte-identical to the new canonical):

* `bots/the-hotchocolabot/examples/SafeDOMExample.affine`
* `bots/echidnabot/examples/SafeDOMExample.affine`
* `bots/finishingbot/examples/SafeDOMExample.affine`

The canonical:

* `module SafeDOMExample;` header (AffineScript file-is-the-module
  per ADR-011).
* `use prelude::{Option, Some, None, Result, Ok, Err};` — current
  qualified-path syntax (ADR-014).
* `enum MountStatus { Mounted(Element), ... }` / `enum MountResult
  { Mounted([Element]), Failed(String) }` (was `type X = A | B`).
* `struct MountSpec { selector: String, html: String }` (was
  anonymous-record `{ selector: ..., html: ... }` without the
  `#{`-sigil ADR-215 requires).
* Callbacks passed as separate `fn(X) -> ()` parameters rather than
  as fields of a `MountCallbacks` record (fn-typed struct fields
  are not currently parser-supported — see ADR backlog).
* `Console::log` / `Console::error` rather than `IO.println` /
  `IO.eprintln` (lowercase dot-access).
* `Err(...)` constructor (was `Error(...)` — `Result` is `Ok`/`Err`
  per stdlib).
* `-{IO}->` effect arrow (was `-> () / IO` suffix).

The example references the `SafeDOM` stdlib surface targeted by
affinescript#56 (DOM+Pixi binding survey) which does not yet exist.
`affinescript check` therefore reports `Resolve.UndefinedModule
SafeDOM` — that is the expected residual (and matches the
gitbot-fleet#148 sustainabot validation oracle exactly: parse passes,
cross-module resolution is INT-02 loader-bridge territory).

The other 50 stale copies estate-wide are being addressed in parallel:

* `burble/examples/SafeDOMExample.affine` — migrated (separate PR)
* `claude-gecko-browser-extension/examples/SafeDOMExample.affine` —
  migrated (separate PR)
* 24 copies under `standards/` and 24 under `standards-as-port/` —
  deleted (over-propagated vendored fixtures; the gitbot-fleet
  canonical is the reference). Separate PRs.

Closes #208.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 26, 2026 10:04
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 45 issues detected

Severity Count
🔴 Critical 6
🟠 High 8
🟡 Medium 31

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "expect() in hot path (1 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/gsbot/src/services.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (3 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/glambot/src/analyzers/accessibility.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (3 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/finishingbot/src/analyzers/claims.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (1 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/finishingbot/src/analyzers/license.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (1 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/aria.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (5 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/forms.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (4 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/media.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (2 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/language.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (7 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/semantic.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 718e98f into main May 26, 2026
22 checks passed
@hyperpolymath hyperpolymath deleted the claude/safedom-canonical-148-208 branch May 26, 2026 10:07
hyperpolymath added a commit to hyperpolymath/claude-gecko-browser-extension that referenced this pull request May 26, 2026
…grammar (Refs gitbot-fleet#148, #208) (#30)

Replaces the pre-stabilization-dialect copy with the current-grammar canonical (byte-identical to hyperpolymath/gitbot-fleet#210). Previous content pre-dated ADR-014 / ADR-016 / ADR-215; parse-failed at line 1 of `affinescript check`.

The example references the SafeDOM stdlib surface targeted by affinescript#56; `affinescript check` reports Resolve.UndefinedModule SafeDOM — the expected residual.

Refs hyperpolymath/gitbot-fleet#148
Refs hyperpolymath/gitbot-fleet#208
Refs hyperpolymath/gitbot-fleet#210

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit to hyperpolymath/burble that referenced this pull request May 26, 2026
…grammar (Refs gitbot-fleet#148, #208) (#92)

## Summary

Replaces the pre-stabilization-dialect copy of
`examples/SafeDOMExample.affine` with the current-grammar canonical
(byte-identical to the version landing in
`hyperpolymath/gitbot-fleet#210`). Previous content pre-dated ADR-014
(qualified paths), ADR-016 (effect rows), and ADR-215
(`#{`-record-literal sigil), and parse-failed at line 1 of `affinescript
check` everywhere it lived.

`affinescript check` reports `Resolution error: (Resolve.UndefinedModule
SafeDOM)` — parser layer succeeds; the `SafeDOM` stdlib is targeted by
affinescript#56 (DOM+Pixi binding survey) and is intentionally not yet
implemented.

## Cross-refs

- Refs hyperpolymath/gitbot-fleet#148, #208, #210

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit to hyperpolymath/standards that referenced this pull request May 26, 2026
…on copies (#188)

## Summary

Deletes 24 byte-identical pre-stabilization-dialect copies of
`SafeDOMExample.affine` from 24 sub-trees in this repo. All 24
parse-fail at line 1 of `affinescript check` — they pre-dated ADR-014
(qualified paths), ADR-016 (effect rows), and ADR-215
(`#{`-record-literal sigil). They were never authoritative; the
over-propagation appears to have come from an earlier
template-instantiation script run.

## Why delete rather than migrate

Per the gitbot-fleet#208 sweep strategy: standards/ vendors canonical
templates, not duplicate consumer examples. The 5 canonical migrated
copies live in:
- `hyperpolymath/gitbot-fleet#210` (3 copies under `bots/*/`)
- `hyperpolymath/burble#92` (1 copy)
- `hyperpolymath/claude-gecko-browser-extension#30` (1 copy)

Once SafeDOM stdlib lands (affinescript#56), a single reference copy
under `affinescript/examples/` becomes the source of truth.

## Safety

Per the SafeDOMExample-estate-wide search report (2026-05-26), no
load-bearing reference in this repo or any other points at the `.affine`
copies being deleted. The 6 references estate-wide all target
`SafeDOMExample.res` (Idris2 smoke-test fileExists, `eclexiaiser.toml`
source) — those `.res` files are out of scope and tracked under
affinescript#57 Phase 2.

## SPDX side-benefit

Each deleted file carried `SPDX-License-Identifier: PMPL-1.0-or-later`
(pre-2026-05-25 policy refresh). Deletion removes the PMPL-licensed
content too.

## Cross-refs

- Refs hyperpolymath/gitbot-fleet#148, #208
- Refs hyperpolymath/gitbot-fleet#210, hyperpolymath/burble#92,
hyperpolymath/claude-gecko-browser-extension#30

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Stale AffineScript dialect in 3 SafeDOMExample.affine fixtures (parse-fails on current grammar)

1 participant