TRANSITION.md — Core Action Grid

Copy Markdown View Source

Global, long-lived facts. Framework modules, CLI tools, universal predicates, user profile.


Toolkit: agent-browser

ARM64 Chromium-based headful browsing CLI

Installation

npm i -g agent-browser
agent-browser install    # downloads Chromium (x86_64 only!)

ARM64 gotcha

On ARM64 Linux, agent-browser install downloads an x86_64 Chromium that won't run. Use system Chromium instead:

agent-browser --executable-path /usr/bin/chromium <command>

To avoid repeating the flag, export:

export AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium

Core workflow

1. open <url>           navigate to page
2. snapshot -i           get accessibility tree with @refs (interactive only)
3. click @ref            interact
4. eval "js_code"        arbitrary JS when snapshot refs aren't enough
5. get url / get title   check current state

Typical Google News session

# Open
agent-browser --executable-path /usr/bin/chromium open https://news.google.com

# Google shows a consent wall — find and click "Accept all"
agent-browser --executable-path /usr/bin/chromium snapshot -i
agent-browser --executable-path /usr/bin/chromium click @e11   # Accept all

# If consent wall is stubborn, use JS:
agent-browser --executable-path /usr/bin/chromium eval \
  "document.querySelector('[aria-label=\"Accept all\"]')?.click() || 
   [...document.querySelectorAll('button')].find(b=>b.textContent.includes('Accept all'))?.click()"

# Snapshot for headlines
agent-browser --executable-path /usr/bin/chromium snapshot -i

# Extract text via JS
agent-browser --executable-path /usr/bin/chromium eval \
  "JSON.stringify([...document.querySelectorAll('article h4, article h3')].map(e=>e.textContent.trim()).filter(Boolean))"

Key lessons

#Insight
1snapshot -i is the primary recon tool — always run it first after navigation
2@ref numbers change on each snapshot; never reuse stale refs
3Google services almost always throw a consent dialog first — handle it before anything else
4JS eval is the escape hatch: use document.querySelector with aria labels for resilient clicking
5ARM64: never use agent-browser install, always system Chromium via --executable-path
6Headlines live in <article><h3>/<h4> on Google News

Predicates

<< agent-browser, depends_on, system-chromium >>
<< agent-browser, install_method, arm64-workaround >>
<< google-news, has_barrier, consent-dialog >>
<< consent-dialog, bypass_method, js-click-aria-label >>
<< google-news, headline_container, article > h3 >>
<< google-news, headline_container, article > h4 >>
<< snapshot, primary_command, snapshot -i >>
<< refs, are_volatile, between_snapshots >>

User Profile: Momoka

<< Momoka, role, AI-engineer >>
<< Momoka, os_preference, Linux >>
<< Momoka, shell, bash >>
<< Momoka, machine, ARM64 >>
<< Momoka, version_control, git >>
<< Momoka, commit_convention, conventional-commits >>

Sanitisation Rules

  • Never classify or archive triples — append only
  • Predicate wording is free-form
  • One idea can span multiple triples
  • Binary rule: global & long-lived → TRANSITION.md / local & transient → PROJECT_TRANSITION.md

Toolkit: Mathematica / Wolfram

From MEMORY.md (2026-05-18, recovered from dangling commit b23141b)

The problem

wolframscript hangs in PTY environments — interactive mode conflict.

The solution

Use the traditional math CLI kernel instead:

# Quick one-liner
echo '2+2' | math

# Complex script
math < script.m

Kernel: Mathematica 14.1.0 for Linux ARM (64-bit). Startup takes ~10s; computation is fast.

Verified capabilities

DomainExampleResult
Arithmetic2+24
IntegrationIntegrate[x^2, x]x^3/3
FactorizationFactorInteger[123456789]3² × 3607 × 3803
High-precision πN[Pi, 50]50 digits
TrigSin[Pi/4]1/√2
Matrix opsA . A
Equation solvingSolve[x^3-6x^2+11x-6==0]{x→1, x→2, x→3}
Numeric integrationNIntegrate[Sin[x]/x, {x,0,Infinity}]1.5708 (= π/2)

Critical trap: MatrixForm

MatrixForm is a DISPLAY WRAPPER, not a matrix.
 Print[MatrixForm[A] . MatrixForm[A]]
 Print[MatrixForm[A . A]]

Never use MatrixForm inside computations — only as the outermost wrapper.

Predicates

<< wolframscript, incompatible_with, PTY >>
<< math, compatible_with, PTY >>
<< math, startup_latency, ~10s >>
<< math, usage_mode, echo_pipe >>
<< math, usage_mode, heredoc_file >>
<< MatrixForm, is_a, display_wrapper >>
<< MatrixForm, must_be, outermost >>

Anti-Pattern: Git Submodules for Local Archives

From MEMORY.md commit chain (2026-05-25)

Don't use git submodule to archive local directories. It creates:

  • A pointer commit (160000 mode) instead of actual content
  • Broken references when the submodule path isn't a real repo

Just use plain files. Every time.

<< git-submodule, anti_pattern_for, local-archiving >>
<< local-archiving, correct_approach, plain-files >>

PTY Session Resilience

From MEMORY.md (2026-05-15)

What locks a session

Any program that takes over the terminal: interactive editors (vim, nano, emacs), wolframscript, pagers, etc.

Recovery

list_sessions              # find stuck agent_id
reset_session <agent_id>   # kill and restart

Prevention

  • Avoid interactive TUI programs inside execute_script
  • Use non-interactive alternatives: sed instead of vim, echo '...' | math instead of wolframscript

  • For long operations, use execute_script (async) + get_task_result polling
<< PTY_session, killer, interactive_TUI >>
<< PTY_session, recovery, reset_session >>
<< PTY_session, prevention, non-interactive_alternatives >>

First Contact Record

<< first_contact, date, 2026-05-14 >>
<< first_exam_session, date, 2026-05-14T16:12_CST >>
<< user_ip, geo, Shanghai_China_Mobile >>
<< user_timezone, offset, UTC+8 >>
<< user_timezone, name, Asia/Shanghai >>