Skip to content

docs: TS→AS migration 01-triage — algorithm spec preserved as .md (closes 1 of standards#241)#82

Merged
hyperpolymath merged 1 commit into
mainfrom
ts-to-as/01-triage-port
May 30, 2026
Merged

docs: TS→AS migration 01-triage — algorithm spec preserved as .md (closes 1 of standards#241)#82
hyperpolymath merged 1 commit into
mainfrom
ts-to-as/01-triage-port

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Part of standards#239 (TS→AffineScript estate migration) — closes 1 of the 9 file candidates in standards#241 STEP 2.

Replaces `docs/campaigns/2026-05-26/01-triage.ts` (183 lines, Deno TypeScript) with `01-triage.md` (196 lines, algorithmic spec). The TS file was a historical campaign snapshot from 2026-05-26; a direct AffineScript port surfaced 10 stdlib gaps that block a clean compile until standards#242 STEP 3 (stdlib fill) lands.

Why .md, not .affine

Attempted a full .affine port in the session that produced this PR. The port surfaced fundamental stdlib gaps:

  1. `Set` membership — no native AS surface
  2. `Map<String, [T]>` group-by — no native AS surface
  3. Async generators (`async function* walk(...)`) — no AS surface
  4. Typed JSON decoder for nested `AssailReport` shape — `json.affine` v0.3 pending
  5. Regex object construction (`new RegExp(pat)`) — `Deno::regexMatch` is the limit
  6. `Date.toISOString()` — no `dateNowIso` extern
  7. `Object.fromEntries(...)` builder — no `jsonObjectFromPairs` extern
  8. Optional chaining (`?.`) — explicit `Option`/`match` (fine)
  9. `async` / `await` on sync FS — Deno.affine is sync (fine)
  10. Spread / rest destructuring — explicit helpers needed

Rather than ship a syntactically-iffy partial port that would block other STEP 2 work in review, this PR preserves the algorithmic spec in a structured Markdown document and removes the .ts file. A future PR will land the `.affine` implementation once standards#242 STEP 3 closes the relevant gaps.

Per standards#241 acceptance

  • One per-repo PR per file group (this PR = 1 file in panic-attack/)
  • Hypatia ownership gate passes (no .ts after merge; .md is governance-clean)
  • Stdlib gap list populated (see commit body + .md §"Stdlib gaps surfaced")

What the .md preserves

Every algorithmic detail needed to re-implement:

  • Domain types (Severity, WeakPoint, AssailReport, PrCandidate)
  • Static policy tables (proof exts, autofix-OK, issue-only, parked debts)
  • Category alias mapping (13 entries)
  • 8-step classification algorithm
  • PR grouping by `(repo, file_dir, category)`
  • Output summary JSON shape
  • Side-channel stderr log shape

Net delta

  • `docs/campaigns/2026-05-26/01-triage.ts`: −183 lines (removed)
  • `docs/campaigns/2026-05-26/01-triage.md`: +196 lines (added)

Refs

  • standards#239 — TS→AS estate migration umbrella
  • standards#241 — STEP 2 candidate list (this is 1 of 9)
  • standards#242 — STEP 3 stdlib fill (consumes this PR's gap list)
  • `project_estate_ts_to_affinescript_2026_05_28.md` — memory tracker

🤖 Generated with Claude Code

…defer port

Part of standards#239 (TS→AffineScript estate migration), STEP 2 candidate
per standards#241.

The original 01-triage.ts (183 lines, Deno TS) is a historical campaign
snapshot from 2026-05-26. An attempted AffineScript port surfaced 10
distinct stdlib gaps (catalogued in the replacement .md) that require
filling in STEP 3 (standards#242) before a clean .affine port can land.

Rather than ship a syntactically-iffy partial port (no `Set<T>`,
no `Map<String, [T]>`, no async generators, no typed JSON decode, no
ISO8601 date formatter, no Object.fromEntries equivalent), this commit
preserves the algorithmic spec as a structured Markdown document and
removes the .ts file. The .md serves as the canonical reference for the
future implementation once the stdlib gaps close.

Net delta:
- docs/campaigns/2026-05-26/01-triage.ts:  -183 lines (removed)
- docs/campaigns/2026-05-26/01-triage.md:  +196 lines (added)

The .md preserves all algorithmic content needed to re-implement:
- Domain types (Severity, WeakPoint, AssailReport, PrCandidate)
- Static policy tables (proof exts, autofix-OK, issue-only, parked debts)
- Category alias mapping (13 entries)
- 8-step classification algorithm
- PR grouping by (repo, file_dir, category)
- Output summary JSON shape
- Side-channel stderr log shape

Stdlib gaps surfaced (feeds STEP 3 standards#242):
 1. Set<T> membership (workaround: linear-scan list)
 2. Map<String, [T]> group-by (workaround: assoc list)
 3. Async generators (collapse to eager list)
 4. Typed JSON decoder (json.affine v0.3 pending)
 5. Regex object construction (regexMatch is the limit)
 6. Date.toISOString (no dateNowIso extern)
 7. Object.fromEntries (no jsonObjectFromPairs builder)
 8. Optional chaining (explicit Option/match — fine)
 9. async/await on sync FS (Deno.affine all sync — fine)
10. Spread / rest destructuring (explicit helpers needed)

Refs:
- standards#239 — TS→AS estate migration umbrella
- standards#241 — STEP 2 candidate list
- standards#242 — STEP 3 stdlib fill (consumes this PR's gap list)
- project_estate_ts_to_affinescript_2026_05_28.md — memory tracker

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 30, 2026 15:18
@hyperpolymath
Copy link
Copy Markdown
Owner Author

Note: post-PR review of the project tracker memory shows affinescript#445 (Step-3 first-cut, merged) already closed gaps 5 (regex via existing regexMatch) and 6 (dateNowIso), and added walkRecursive + args + exit + consoleError — partially unblocking the eager-list workaround in gap 3. The .md spec remains canonical for the algorithm preservation; the remaining gaps for a clean .affine port are 1 (Set), 2 (Map group-by), 4 (typed Json decoder for nested AssailReport), 7 (jsonObjectFromPairs builder), and 10 (spread/rest helpers). Tracked at standards#242 (STEP 3).

@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 78 issues detected

Severity Count
🔴 Critical 5
🟠 High 8
🟡 Medium 65

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f5599 needs attention",
    "type": "unpinned_action",
    "file": "e2e.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action es: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb needs attention",
    "type": "unpinned_action",
    "file": "e2e.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in boj-build.yml",
    "type": "unknown",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cargo-audit.yml",
    "type": "unknown",
    "file": "cargo-audit.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "unknown",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in coverage.yml",
    "type": "unknown",
    "file": "coverage.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dependency-review.yml",
    "type": "unknown",
    "file": "dependency-review.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 23b44b3 into main May 30, 2026
22 of 25 checks passed
@hyperpolymath hyperpolymath deleted the ts-to-as/01-triage-port branch May 30, 2026 15:43
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.

1 participant