feat(website): add beginner examples and synchronized publishing (#1203)

feat(website): add beginner examples and synchronized publishing
This commit is contained in:
Ysopwnable
2026-10-09 12:41:51 +08:00
committed by GitHub
18 changed files with 3053 additions and 119 deletions
+89 -1
View File
@@ -19,12 +19,33 @@ jobs:
contents: read
pages: read
steps:
- name: Require Cloudflare publishing credentials
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
if [[ -z "$CLOUDFLARE_API_TOKEN" || -z "$CLOUDFLARE_ACCOUNT_ID" ]]; then
echo "::error::Set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID in repository Actions secrets before publishing."
exit 1
fi
- name: Check out the repository
uses: actions/checkout@v4
- name: Prepare the example download
run: python3 scripts/prepare-website.py
- name: Check website links and publishing configuration
run: python3 scripts/verify-website.py
- name: Record the published commit
run: |
python3 - <<'PY'
import json
import os
from pathlib import Path
Path("website/public/deployment.json").write_text(
json.dumps({"commit": os.environ["GITHUB_SHA"]}) + "\n",
encoding="utf-8",
)
PY
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload the website
@@ -35,14 +56,81 @@ jobs:
deploy:
needs: prepare
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 15
permissions:
contents: read
actions: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out publishing configuration
uses: actions/checkout@v4
- name: Set up Node.js for Wrangler
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Download the verified website
uses: actions/download-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}/website-archive
- name: Extract the shared publishing artifact
run: |
mkdir -p "$RUNNER_TEMP/rea-website-public"
tar -xf "$RUNNER_TEMP/website-archive/artifact.tar" -C "$RUNNER_TEMP/rea-website-public"
- name: Publish the website to Cloudflare
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4.149.0"
packageManager: npm
command: deploy --cwd website --env production --assets "${{ runner.temp }}/rea-website-public"
- name: Publish to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Verify both published revisions
env:
PAGES_URL: ${{ steps.deployment.outputs.page_url }}
run: |
python3 - <<'PY'
import json
import os
import sys
import time
from urllib.error import URLError
from urllib.parse import urljoin
from urllib.request import Request, urlopen
expected = os.environ["GITHUB_SHA"]
pages_url = os.environ["PAGES_URL"]
if not pages_url:
sys.exit("GitHub Pages returned no published URL.")
pending = {"Cloudflare": "https://rea.tools/", "GitHub Pages": pages_url}
for attempt in range(24):
for name, base in list(pending.items()):
url = urljoin(base, "deployment.json") + "?commit=" + expected
try:
request = Request(url, headers={"Cache-Control": "no-cache"})
with urlopen(request, timeout=10) as response:
actual = json.load(response).get("commit")
if actual == expected:
print(f"{name} serves {expected}: {base}")
del pending[name]
else:
print(f"Waiting for {name}: observed revision {actual}")
except (URLError, TimeoutError, ValueError) as error:
print(f"Waiting for {name}: {error}")
if not pending:
break
if attempt < 23:
time.sleep(5)
if pending:
sys.exit("Published revision did not match on: " + ", ".join(pending))
with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as summary:
summary.write(f"Published commit `{expected}` to [rea.tools](https://rea.tools/) "
f"and [GitHub Pages]({pages_url}).\n")
PY
+1
View File
@@ -49,6 +49,7 @@ Thumbs.db
# Generated website download
/website/public/examples/notes-example.zip
/website/public/deployment.json
# Local Cloudflare development state
/website/.wrangler/
+3 -2
View File
@@ -19,5 +19,6 @@ for asset notes and the source of case-study claims.
- Check both local root and `/rea/` paths, mobile layouts, expanded details,
copying and downloads. Run `scripts/prepare-website.py` followed by
`scripts/verify-website.py`.
- Keep `website-pages.yml` as the sole, manual Pages publisher. Follow the
publication procedure in the website README.
- Keep `website-pages.yml` as the sole, manual production publisher for
Cloudflare and Pages. Both hosts must receive the same verified artifact and
pass the published-commit check. Follow the website README.
+76 -18
View File
@@ -6,7 +6,8 @@
An English static website with explanatory figures, worked guides and DX-Ball, Notion, TH04 and CTF investigations.
The public files are in `website/public/`. The site uses HTML, CSS and a small
script for copying code and following the assembly-to-C comparison. Python
scripts for copying code, following code comparisons and playing the dinosaur
speed reconstruction. Python
packages the downloadable example; there is no frontend bundler or npm dependency.
[style-guide.md](style-guide.md) explains the writing, page structure, figures,
@@ -25,7 +26,9 @@ Open <http://127.0.0.1:4173/>. Refresh the browser after editing a file.
## Pages
- `public/index.html`: product introduction and case-study overviews.
- `public/index.html`: compact setup, reverse-engineering definition and purpose, manual/agent comparison, dinosaur and Calculator examples, and case-study overviews.
- `public/examples/dino-lab/index.html`: adjustable-speed mini-game, recovered rule, original-game check and browser analysis steps.
- `public/first-investigation/index.html`: a guided Notes export investigation, from setup to a checked CSV prediction.
- `public/showcase/index.html`: the case-study index.
- `public/showcase/dx-ball/index.html`: sound-pan investigation and project status.
- `public/showcase/notion/index.html`: Notion's Electron clipboard bridge and rich clipboard format.
@@ -60,6 +63,12 @@ by Git; website checks and each manual publication regenerate it before checking
and uploading the public directory. The verifier checks that its entries match
the current source and contain no extra files.
The first-investigation page uses this same ZIP. Its prompt lets the agent
download and unpack the target; the download button provides a manual path.
The reader follows the static export trace, then runs the CSV formatter with
one changed input. This formatter check needs only Node.js. The separate
browser Notes example has a different implementation.
Agent terminals show example prompts, not transcripts of previous
investigations. All cursors blink continuously with the same CSS animation,
respecting reduced-motion preferences. Both the prompt and animation work
@@ -88,7 +97,42 @@ Evidence. [evidence/dx-ball-sound-pan.md](evidence/dx-ball-sound-pan.md) records
their provenance and the scope of the validation claims. The original executable
and complete private Evidence records are not website assets.
The homepage and DX-Ball overview diagrams are maintained as SVG source. Initial layout references were
The homepage starts with a short installation prompt and the ordinary setup
command, then explains what reverse engineering is and why someone would use
it. The manual/agent comparison introduces REA’s role before the examples.
The comparison uses the same Calculator question on both sides: three
selectable manual steps pair original instructions with an analyst illustration
and thought bubbles; the agent side begins with “One prompt.” and a copyable
question. Thoughts illustrate the reasoning behind the findings. The shared
code-step script selects the initial note on load, so all three notes remain
readable when JavaScript is disabled.
The original-instruction panel starts expanded on desktop. On narrow screens,
the homepage script collapses it; a native disclosure keeps the code available
while the thought bubble and agent prompt remain close together.
Dinosaur is the first example; Calculator follows as the native example.
Both name the goal and the reason to inspect the program before showing the
demo. A labeled finding explains what REA returned, and the flow distinguishes
REA’s inspection from the agent’s interpretation and implementation.
Its game precedes the prompt and code on small screens. Calculator’s excerpt
comes from an installed model DLL; Microsoft’s public implementation supplies
names and a crosscheck. Its controls apply the percentage rule to generic inputs.
The dinosaur example connects an inspected running script to a new playable
mini-game. `public/assets/dino-speed.js` owns the recovered speed rule and replay;
`dino-demo.js` imports it for automatic acceleration. The slider chooses a fixed
speed instead. Drawing, jumping and collision code are newly authored for this
teaching game. It starts on input, pauses when hidden or outside the viewport,
and retains a static SVG when JavaScript is disabled. The lab links the speed
module and complete game source, and replays the rule against recorded
original-game values.
[evidence/calculator-and-dino.md](evidence/calculator-and-dino.md) records both
targets, selected findings, attribution and verification scope. Update the
speed rule, game, check table and evidence together. The original script excerpt
and its BSD license are credited on the pages. Prompt responses are example
explanations based on findings.
The general investigation and DX-Ball overview diagrams are maintained as SVG source. Initial layout references were
created with the built-in image generation tool; [figures.md](figures.md) retains
their prompts and the current asset notes. Figures provide an overview;
REA requests, assembly and C remain selectable HTML text. On narrow
@@ -141,7 +185,7 @@ Wrangler version without adding it to REA's package dependencies.
Cloudflare documents static-asset requests as free and unlimited, with no
additional storage cost. See [billing and limitations](https://developers.cloudflare.com/workers/static-assets/billing-and-limitations/).
### Preview and deploy
### Local and hosted previews
Run these commands from the repository root. `--cwd website` makes the build
paths consistent with the website configuration. Preview locally first:
@@ -186,13 +230,7 @@ See Cloudflare's [nameserver setup procedure](https://developers.cloudflare.com/
for the complete migration steps. A CNAME to the preview's `workers.dev` hostname
at the current DNS provider does not configure a Workers Custom Domain.
Publish to the production Worker:
```sh
npx wrangler@4.149.0 deploy --cwd website --env production
```
This creates or updates `rea-website`, attaches `rea.tools`, and lets Cloudflare
The production environment creates or updates `rea-website`, attaches `rea.tools`, and lets Cloudflare
manage its DNS record and HTTPS certificate. Deployment can succeed while the
zone is pending; verify public HTTPS after activation and certificate issuance.
An existing CNAME at `rea.tools`
@@ -206,15 +244,34 @@ Verify <https://rea.tools/>, <https://rea.tools/guides/javascript/>,
resolve correctly. The root README and browser guide use `https://rea.tools/`
as the public website URL.
Deployments are manual. The existing GitHub Pages publisher remains available
as a separate host; it does not publish to Cloudflare.
Production publication uses the synchronized GitHub Actions workflow below.
Local Wrangler commands above publish only the separate preview Worker.
## GitHub Pages
## Synchronized production publishing
`.github/workflows/website-pages.yml` prepares and deploys only `website/public`.
It is the sole Pages publisher, manually triggered and restricted to `main`;
`.github/workflows/website-pages.yml` prepares `website/public` once and deploys
the same artifact to Cloudflare (`rea.tools`) and GitHub Pages. It is the sole
production publisher, manually triggered and restricted to `main`;
ordinary pushes and pull requests do not publish the site.
Configure these repository **Actions secrets** before publishing:
- `CLOUDFLARE_API_TOKEN`: a Cloudflare token using the **Edit Cloudflare Workers**
template, scoped to the website's account and zone.
- `CLOUDFLARE_ACCOUNT_ID`: that Cloudflare account's ID.
See Cloudflare's [GitHub Actions authentication instructions](https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/).
The workflow checks that both secrets are present before preparing a release.
Cloudflare deploys first; GitHub Pages deploys after that step succeeds.
Preparation adds `deployment.json` with the workflow's commit SHA. Cloudflare
receives the extracted Pages artifact through Wrangler's explicit assets path;
the local custom-build output is not the uploaded directory. The workflow then
checks both public version markers and reports success only when they match
that commit. A failed publication remains failed; fix its cause and rerun the
workflow to complete both deployments. The two hosts can update at different
times while a run is in progress.
Website checks run only for pull requests that change `website/`, the verification
script or workflow definitions. They check local links, HTML fragments, SVG XML
and the single Pages publisher without installing npm dependencies. The same
@@ -233,8 +290,9 @@ the old site.
After the site is approved and merged, select **GitHub Actions** under the
repository's **Settings → Pages → Build and deployment**. Then run **Publish REA
website** from the Actions tab on `main`. The workflow uses the `github-pages`
environment and the official Pages actions.
website** from the Actions tab on `main`. This publishes both production hosts.
The workflow uses the `github-pages` environment, the official Pages actions and
Cloudflare's Wrangler action.
The equivalent CLI command is:
+145
View File
@@ -0,0 +1,145 @@
# Calculator and dinosaur beginner examples
Evidence collected on 9 October 2026 with the published REA 4.1.0 package.
The homepage offers compact setup first, then a reverse-engineering definition,
purpose and manual/agent comparison. Dinosaur is the first worked example;
Calculator is the second. Each states its goal, why the program is inspected,
what REA returned and how the agent uses it.
Prompts and replies are examples based on the
findings below. Selected code and generic inputs are public; raw captures stay
outside the website.
## Windows Calculator
### Inspected artifacts
The installed Windows Calculator package is version `11.2508.4.0`, x64.
| Artifact | SHA-256 |
| --------------------------- | ------------------------------------------------------------------ |
| Windows `calc.exe` launcher | `9c2c8a8588fe6db09c09337e78437cb056cd557db1bcf5240112cbfb7b600efb` |
| Package `CalcViewModel.dll` | `07a1953bbf828a3495662c4b4bde1c80c9075061e0e389eabac5f8c544710df5` |
REA's function dossier for launcher `0x1400019f4` includes the call to
`ShellExecuteW` with `ms-calculator:`. Evidence:
`ev_e97a6a1a61bfe63476a13e6285d71dd838101066f7863c9af822861050203ea5`.
The calculation is in the installed app's model DLL. REA inspected function
`0x1801245d0`, whose body occupies two ranges, totaling 10,656 bytes:
`0x1801245d0–0x180126f4c` and `0x180126f55–0x180126f77`.
Evidence:
`ev_830a710c7fb55a08ac896fb5783c14339480a57a96d6d45c57c024b6a43239d0`.
REA supplied pseudocode, original instructions, calls and references. Its
`case 0x76` checks the operator field against `0x5c` and `0x5b` and constructs
the constant 100 in both paths. One path divides the current value by 100;
the other combines the current value with the previous value divided by 100.
The published assembly is selected exactly from the returned instruction list.
The opening manual/agent comparison selects instructions at
`0x180124945–0x180124992` and `0x180124a14–0x180124a34`, with explicit omissions.
Its three highlights identify the operator comparisons, construction of 100
and arithmetic helper calls, and the final multiplication path. The analyst
thought bubbles illustrate the work of decoding those facts; they are not a
recorded analyst transcript or a measured comparison of investigation times.
The same percentage question appears in the agent prompt. Helper meanings and
operator names are interpretations checked against the public source below.
The binary is stripped. A local instruction scan located candidates using
operator IDs and the constant 100; REA then produced the complete function
dossier. Function selection was analyst-assisted. The illustrative agent
prompt is not a recording of an autonomous end-to-end discovery.
### Source interpretation and check
Microsoft's MIT-licensed source at commit
`d125246a4e19842ce1332e6c7839cf0e110027d8` supplies the operator meanings and
an independently readable implementation:
- [Operator IDs](https://github.com/microsoft/calculator/blob/d125246a4e19842ce1332e6c7839cf0e110027d8/src/CalcManager/Header%20Files/CCommand.h): `IDC_DIV = 91`, `IDC_MUL = 92`, `IDC_PERCENT = 118`.
- [Percentage branch](https://github.com/microsoft/calculator/blob/d125246a4e19842ce1332e6c7839cf0e110027d8/src/CalcManager/CEngine/scifunc.cpp#L98-L111): multiply/divide uses `rat / 100`; other operators use `rat * (m_lastVal / 100)`.
- [Standard-mode tests](https://github.com/microsoft/calculator/blob/d125246a4e19842ce1332e6c7839cf0e110027d8/src/CalculatorUnitTests/CalculatorManagerTest.cpp#L350-L370): `6 × 6 % = 0.36` and `50 + 20 % = 60`.
These source branches agree with the operator checks and two paths observed
in the installed DLL. The public source commit is a crosscheck; it is not an
identified build commit for that installed package. No PDB symbols were loaded.
The homepage's named C-like rule is an explanatory summary. Its `200 + 10%`
and `200 × 10%` controls compute those cases from that rule using the fixed
inputs 200 and 10. Browser checks exercise
both percentage illustrations, their results, operator selection and reset.
The Microsoft tests were inspected, not executed. A probe-owned Calculator
window could be inspected, but it was no longer present at the input-check
step; no completed Windows GUI input result is claimed.
## Dinosaur speed
### Running target and source
REA inspected the HTTP page
<https://wayou.github.io/t-rex-runner/> in an owned Chrome 150.0.7871.124
session through a loopback debugging connection. This is wayou's
Chromium-derived browser edition. REA's HTTP(S) page inspection does not
select `chrome://dino/`; the website identifies the HTTP edition as its target.
The returned `index.js` source contains 90,241 UTF-8 bytes, SHA-256
`e7a50d337bdbe4299068de034e4564cfe5fd45ca9257ded37b6ada9330cedf0f`.
Evidence:
`ev_7a09de570cf6b64907504046485cab69ad444828964106eabc05958799749905`.
This digest also matches `index.js` in repository commit
`5455bfa408ec6b707c7300ff194b7390733a766d`. Source locations:
- [Settings](https://github.com/wayou/t-rex-runner/blob/5455bfa408ec6b707c7300ff194b7390733a766d/index.js#L106-L135): `ACCELERATION: 0.001`, `MAX_SPEED: 13`, `SPEED: 6`.
- [Update branch](https://github.com/wayou/t-rex-runner/blob/5455bfa408ec6b707c7300ff194b7390733a766d/index.js#L565-L571): increment speed on a collision-free update while speed is below the threshold.
The source begins with the Chromium Authors' 2014 copyright notice. Selected
excerpts are credited on the page. The repository's BSD license and the source
copyright are reproduced in `public/assets/licenses/dinosaur.txt`.
### Controlled original-game check
After the passive REA inspection, a separate Playwright controller called the
original page's `Runner.update()` repeatedly. It disabled future update
scheduling and obstacle generation, set the starting speed to 6, and kept the
game in its playing state. The control is credited separately from REA's
read-only inspection.
| Update count | Observed speed | Display rounded to 3 decimals |
| ------------ | ------------------ | ----------------------------- |
| 0 | 6 | 6.000 |
| 1,000 | 7.000000000000334 | 7.000 |
| 4,000 | 9.99999999999956 | 10.000 |
| 7,000 | 12.999999999997897 | 13.000 |
| 10,000 | 13.000999999997896 | 13.001 |
The branch compares before adding. Floating-point increments can cross the
threshold by one increment; the reconstruction preserves this behavior rather
than introducing a clamp.
### New game and reader experiment
`public/assets/dino-speed.js` contains the reconstructed rule and an update-count
replay. Its rounded results match the original-game check above. The website's
mini-game imports this rule. It advances its own simulation at 60 updates per
second, avoiding a different frame rate changing its demonstration pace.
The canvas drawing, dinosaur shape, jump physics, rectangle collision detection,
spacing and controls are newly authored teaching code. The reconstruction claim
is scoped to the speed rule. Changing the slider selects a fixed speed between
2 and 18; selecting automatic acceleration restores the starting speed of 6.
The new game starts only after user input. It supports Play/Pause, Jump, Restart,
canvas Space/Up keys and touch. It pauses when hidden or scrolled out of view.
Without JavaScript, a static SVG, source excerpts and recorded results remain
available. The downloadable speed module and complete game source are linked
from the lab.
## Review checks
Website checks cover root and `/rea/` hosting, 320/390/850/1440px layouts,
expanded evidence, copying, no-JavaScript content, reduced motion, the two
percentage rules and the game controls. Game checks include speed selection,
automatic acceleration, a collision, restart, jump height on the rendered
canvas, pause and the original-rule replay. Existing Notes and DX-Ball pages
remain part of layout checks.
+16
View File
@@ -36,6 +36,22 @@ contents. Website verification compares every ZIP entry to its source file and
rejects extra entries. Existing source digests and static findings remain valid
for the unzipped example.
## First-investigation formatter check
The first-investigation page reuses the unchanged Electron fixture and recorded
static findings above. On 9 October 2026, its generated ZIP was unpacked and the
page's formatter command was run with Node.js 24.18.0. The input
`[{ id: 1, title: 'Hello, "REA"' }]` produced:
```csv
id,title
1,"Hello, ""REA"""
```
That check executes `toCsv` from the unzipped `csv.js`. It checks formatting;
the export destination remains a conclusion from `main.js`. No Electron app
launch or new native analysis was needed for this website revision.
## Notes browser example
The three-file browser app is in `website/public/examples/notes-web/`.
+31
View File
@@ -13,6 +13,7 @@ The published diagrams are SVG source assets:
- `public/assets/figures/rea-investigation-flow.svg` — 1774 × 887 viewBox.
- `public/assets/figures/dx-ball-sound-pan-investigation.svg` — 1774 × 887 viewBox.
- `public/assets/figures/th04-bullet-ring.svg` — 1000 × 520 viewBox.
- `public/assets/figures/analyst-thinking.svg` — 160 × 120 viewBox.
Two original layout references were generated with the built-in image generation
tool and reviewed visually. Their prompts are retained below. The final SVGs
@@ -42,6 +43,36 @@ branches when changing these figures. Match progress claims to the pinned
reconstruction checkpoint. Validate the SVG as XML and inspect its browser
rendering at desktop and mobile widths.
## Beginner homepage and dinosaur reconstruction
The manual/agent comparison and Calculator percentage controls are semantic
HTML. Calculator’s assembly comes from a real installed model DLL; the named
calculation is a readable summary crosschecked against Microsoft’s public source. See
[evidence/calculator-and-dino.md](evidence/calculator-and-dino.md).
The introduction pairs selected Calculator instructions with three selectable
analyst thoughts: decode operator branches, trace arithmetic calls, then name
the percentage rule. The small analyst illustration is authored SVG; the
thought bubbles, findings and labels are selectable HTML. The thoughts
illustrate the analysis rather than reproduce a recorded conversation. The
agent side asks the same question and separates REA’s evidence from the
agent’s explanation. Keep those roles and the instruction highlights aligned
when changing a step.
The homepage explains reverse engineering before the worked examples. Each
example opens with its goal and reason for inspecting the program. A selected
highlight marks the intended result; the “REA returned” block identifies the
evidence. The flows label REA’s inspection and the agent’s interpretation or
reconstruction explicitly. Preserve this context when moving a demo.
The dinosaur sequence uses an HTML flow: inspect the loaded script, rebuild the
speed rule, then change and play. Its canvas mini-game and static SVG fallback
are authored code, without generated images or copied game sprites. The game
imports the recovered rule from `public/assets/dino-speed.js`; other mechanics
are new teaching code. Check that the fallback is visible with JavaScript
disabled and hidden when the playable canvas loads. Keep the speed settings,
source excerpt, reconstruction and original-result table consistent.
## Original image generation prompts
## Prompt 1
+235
View File
@@ -0,0 +1,235 @@
import { advanceSpeed, simulateSpeed, SPEED_RULE } from "./dino-speed.js";
// A new teaching game around the recovered speed rule. Drawing, jump physics
// and rectangle collision checks are authored for this demo.
function initializeDinoDemo(demo) {
const canvas = demo.querySelector("canvas");
const context = canvas.getContext("2d");
if (context === null) return;
const start = demo.querySelector("[data-dino-start]");
const slider = demo.querySelector("[data-dino-slider]");
const auto = demo.querySelector("[data-dino-auto]");
const output = demo.querySelector("[data-dino-speed]");
const status = demo.querySelector("[data-dino-status]");
const ground = 148;
const dinosaurX = 52;
const dinosaur = new Path2D(
"M16 18V2H48V24H35V32H25V43H16V53H8V32H0V23H6V29H16Z M12 47V59H5V54H8V47Z M24 42V54H31V59H20V47Z M34 29H44V35H39V32H34Z",
);
let speed = SPEED_RULE.start;
let height = 0;
let velocity = 0;
let distance = 0;
let obstacles = [];
let running = false;
let crashed = false;
let frame = 0;
let lastTime = 0;
let elapsed = 0;
const updateSpeedDisplay = () => {
output.value = speed.toFixed(1);
slider.value = speed.toFixed(1);
};
const draw = () => {
context.clearRect(0, 0, canvas.width, canvas.height);
context.strokeStyle = "#b7c0c9";
context.beginPath();
context.moveTo(0, ground);
context.lineTo(canvas.width, ground);
for (let x = -(distance % 70); x < canvas.width; x += 70) {
context.moveTo(x, ground + 7);
context.lineTo(x + 12, ground + 7);
}
context.stroke();
context.fillStyle = "#5b6570";
for (const obstacle of obstacles) {
context.fillRect(
obstacle.x + 6,
ground - obstacle.height,
8,
obstacle.height,
);
context.fillRect(obstacle.x, ground - obstacle.height + 12, 6, 7);
context.fillRect(obstacle.x, ground - obstacle.height + 3, 5, 15);
context.fillRect(obstacle.x + 14, ground - obstacle.height + 19, 7, 6);
context.fillRect(obstacle.x + 17, ground - obstacle.height + 8, 4, 17);
}
context.save();
context.translate(dinosaurX, ground - 59 - height);
context.fillStyle = crashed ? "#8c4b40" : "#294f82";
context.fill(dinosaur);
context.fillStyle = "#ffffff";
context.fillRect(39, 7, 4, 4);
context.restore();
context.fillStyle = "#5b6570";
context.font = "13px monospace";
context.textAlign = "right";
context.fillText(
`DISTANCE ${String(Math.floor(distance / 100)).padStart(4, "0")}`,
580,
28,
);
if (!running) {
context.textAlign = "center";
context.font = "15px system-ui";
context.fillText(
crashed ? "Hit a cactus. Try another speed." : "Space or Jump ↑",
330,
85,
);
}
};
const stop = (message) => {
running = false;
cancelAnimationFrame(frame);
start.textContent = crashed ? "Play again" : "Play";
if (message) status.textContent = message;
draw();
};
const reset = () => {
stop();
crashed = false;
height = 0;
velocity = 0;
distance = 0;
obstacles = [{ x: 550, height: 38 }];
if (auto.checked) speed = SPEED_RULE.start;
elapsed = 0;
start.textContent = "Play";
status.textContent = "Press Play, then jump over the cactus.";
updateSpeedDisplay();
draw();
};
const update = () => {
if (auto.checked) speed = advanceSpeed(speed);
distance += speed;
if (height > 0 || velocity > 0) {
height = Math.max(0, height + velocity);
velocity -= 0.55;
if (height === 0) velocity = 0;
}
obstacles.forEach((obstacle) => {
obstacle.x -= speed;
});
obstacles = obstacles.filter((obstacle) => obstacle.x > -25);
const last = obstacles[obstacles.length - 1];
const gap = 400 + speed * 18;
if (last === undefined || last.x < 600 - gap) {
obstacles.push({ x: 600, height: 38 });
}
const left = dinosaurX + 8;
const right = dinosaurX + 39;
const bottom = ground - height;
if (
obstacles.some(
(obstacle) =>
right > obstacle.x &&
left < obstacle.x + 21 &&
bottom > ground - obstacle.height + 4,
)
) {
crashed = true;
stop("Hit a cactus. Press Play again, or change the speed and restart.");
}
};
const animate = (time) => {
if (!running) return;
elapsed += Math.min(time - lastTime, 100);
lastTime = time;
while (elapsed >= 1000 / 60 && running) {
elapsed -= 1000 / 60;
update();
}
updateSpeedDisplay();
draw();
if (running) frame = requestAnimationFrame(animate);
};
const play = () => {
if (crashed) reset();
if (running) return;
running = true;
lastTime = performance.now();
elapsed = 0;
start.textContent = "Pause";
status.textContent = "Running. Space or Jump clears a cactus.";
frame = requestAnimationFrame(animate);
};
const jump = () => {
if (crashed) reset();
play();
if (height === 0) velocity = 10.5;
};
start.addEventListener("click", () => {
if (running) stop("Paused. Press Play to continue.");
else play();
});
demo.querySelector("[data-dino-jump]").addEventListener("click", jump);
demo.querySelector("[data-dino-reset]").addEventListener("click", reset);
canvas.addEventListener("keydown", (event) => {
if (event.code === "Space" || event.code === "ArrowUp") {
event.preventDefault();
if (!event.repeat) jump();
}
});
canvas.addEventListener("pointerdown", () => {
canvas.focus();
jump();
});
slider.addEventListener("input", () => {
auto.checked = false;
speed = Number(slider.value);
updateSpeedDisplay();
status.textContent = running
? `Fixed speed: ${speed.toFixed(1)}. Space or Jump clears a cactus.`
: `Fixed speed: ${speed.toFixed(1)}. Press Play to try it.`;
draw();
});
auto.addEventListener("change", () => {
if (auto.checked) speed = SPEED_RULE.start;
updateSpeedDisplay();
status.textContent = auto.checked
? "Recovered rule: start at 6, then increase toward 13."
: `Fixed speed: ${speed.toFixed(1)}.`;
});
document.addEventListener("visibilitychange", () => {
if (document.hidden && running) stop("Paused. Press Play to continue.");
});
if ("IntersectionObserver" in window) {
new IntersectionObserver((entries) => {
if (!entries[0].isIntersecting && running)
stop("Paused. Press Play to continue.");
}).observe(demo);
}
demo.querySelector(".dino-fallback").setAttribute("hidden", "");
demo.querySelector(".dino-controls").hidden = false;
canvas.hidden = false;
reset();
}
document.querySelectorAll("[data-dino-demo]").forEach(initializeDinoDemo);
const speedCheck = document.querySelector("[data-speed-check]");
if (speedCheck !== null) speedCheck.hidden = false;
speedCheck?.addEventListener("click", () => {
let matches = true;
document.querySelectorAll("[data-speed-updates]").forEach((cell) => {
const speed = simulateSpeed(
Number(cell.getAttribute("data-speed-updates")),
).toFixed(3);
cell.textContent = speed;
matches =
matches && speed === cell.parentElement.children[1].textContent.trim();
});
document.querySelector("[data-speed-check-status]").textContent = matches
? "Replayed the recovered rule. All four values match the controlled original-game check when rounded to three decimals."
: "The replay differs from the recorded original-game values. Compare the speed rule and settings above.";
});
+21
View File
@@ -0,0 +1,21 @@
// Speed rule recovered from wayou's Chromium-derived browser edition.
// Source and controlled checks: website/evidence/calculator-and-dino.md.
export const SPEED_RULE = Object.freeze({
start: 6,
acceleration: 0.001,
threshold: 13,
});
/** Advance one collision-free update using the inspected speed rule. */
export function advanceSpeed(speed) {
return speed < SPEED_RULE.threshold ? speed + SPEED_RULE.acceleration : speed;
}
/** Replay the recovered rule for a chosen number of updates. */
export function simulateSpeed(updates) {
let speed = SPEED_RULE.start;
for (let update = 0; update < updates; update += 1) {
speed = advanceSpeed(speed);
}
return speed;
}
@@ -0,0 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 120" fill="none">
<title>An analyst thinking at a computer</title>
<g stroke="#5b6570" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 101h136" stroke="#e0e5e9" />
<path d="M24 54h38l-6 35H18z" fill="#f4f6f8" />
<path d="M18 89h53m-33 0-2 12m-8 0h24" />
<path d="M87 57c-10 7-15 18-16 35l23 9h33c-1-14-6-26-18-33" fill="#edf2f8" />
<path d="M89 62v-9m16 10v-8" />
<path d="M88 24c8-5 19-2 22 5 3 9 0 20-8 25-8 4-15-1-16-8l-5-2 4-8v-8" fill="#fff" />
<path d="M83 31c-4-9 0-17 11-19 10-2 19 5 20 14l-7 7-2-8c-7 3-14 4-22 2" fill="#5b6570" />
<path d="M87 35h3m-5 10 7 1" />
<path d="m121 88-22-13-9-26m-5 2 6-4 4 4m4 24-22 12-9-3" stroke="#294f82" />
<path d="m93 83-13 8 13 10m-16-14-8 5-12-2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 844 B

+66
View File
@@ -0,0 +1,66 @@
function initializePercentDemo() {
const demo = document.querySelector("[data-percent-demo]");
if (demo === null) return;
const display = demo.querySelector("[data-percent-display]");
const expression = demo.querySelector("[data-percent-expression]");
const status = demo.querySelector("[data-percent-status]");
const equals = demo.querySelector('[data-percent-key="equals"]');
const operations = demo.querySelectorAll("[data-percent-operation]");
let operation = "add";
let stage = "input";
const render = () => {
const adding = operation === "add";
const previous = 200;
const current = 10;
const percent = adding ? (current * previous) / 100 : current / 100;
const result = adding ? previous + percent : previous * percent;
const operator = adding ? "+" : "×";
expression.textContent =
stage === "result" ? `200 ${operator} ${percent} =` : `200 ${operator}`;
display.textContent = String(
stage === "input" ? current : stage === "percent" ? percent : result,
);
equals.disabled = stage !== "percent";
status.textContent =
stage === "input"
? "Press % to see what happens to 10."
: stage === "percent"
? adding
? "10% of 200 is 20. Press = to add it."
: "For multiplication, 10 becomes 0.1. Press = to multiply."
: `200 ${operator} ${percent} = ${result}.`;
};
operations.forEach((button) => {
button.addEventListener("click", () => {
operation = button.getAttribute("data-percent-operation");
stage = "input";
operations.forEach((candidate) => {
candidate.setAttribute("aria-pressed", String(candidate === button));
});
render();
});
});
demo.querySelectorAll("[data-percent-key]").forEach((button) => {
button.addEventListener("click", () => {
const key = button.getAttribute("data-percent-key");
stage =
key === "reset" ? "input" : key === "percent" ? "percent" : "result";
render();
});
});
demo.querySelector(".percent-operation").hidden = false;
demo.querySelector(".percent-controls").hidden = false;
render();
}
function initializeExpertAssembly() {
const excerpt = document.querySelector("[data-expert-assembly]");
if (excerpt && window.matchMedia("(max-width: 640px)").matches) {
excerpt.open = false;
}
}
initializeExpertAssembly();
initializePercentDemo();
@@ -0,0 +1,34 @@
Selected script excerpts from wayou/t-rex-runner
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Repository license at commit 5455bfa408ec6b707c7300ff194b7390733a766d:
BSD 3-Clause License
Copyright (c) 2022, 牛さん
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+20 -15
View File
@@ -39,23 +39,28 @@ initializeCopyButtons();
function initializeStepComparisons() {
document.querySelectorAll("[data-step-comparison]").forEach((comparison) => {
const buttons = comparison.querySelectorAll("[data-select-step]");
buttons.forEach((button) => {
button.addEventListener("click", () => {
const selected = button.getAttribute("data-select-step");
buttons.forEach((candidate) => {
candidate.setAttribute("aria-pressed", String(candidate === button));
});
comparison.querySelectorAll("[data-step]").forEach((fragment) => {
fragment.classList.toggle(
"is-active",
fragment.getAttribute("data-step") === selected,
);
});
comparison.querySelectorAll("[data-step-note]").forEach((note) => {
note.hidden = note.getAttribute("data-step-note") !== selected;
});
const selectStep = (button) => {
const selected = button.getAttribute("data-select-step");
buttons.forEach((candidate) => {
candidate.setAttribute("aria-pressed", String(candidate === button));
});
comparison.querySelectorAll("[data-step]").forEach((fragment) => {
fragment.classList.toggle(
"is-active",
fragment.getAttribute("data-step") === selected,
);
});
comparison.querySelectorAll("[data-step-note]").forEach((note) => {
note.hidden = note.getAttribute("data-step-note") !== selected;
});
};
buttons.forEach((button) => {
button.addEventListener("click", () => selectStep(button));
});
const initial = Array.from(buttons).find(
(button) => button.getAttribute("aria-pressed") === "true",
);
if (initial) selectStep(initial);
});
}
+782
View File
@@ -269,6 +269,162 @@ section[id] {
max-width: 680px;
margin-top: 2.25rem;
}
.home-hero {
padding-block: 4rem 3.5rem;
}
.home-definition {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
align-items: start;
margin-bottom: 2rem;
}
.home-definition h2,
.home-definition p {
margin: 0;
}
.home-calculation {
margin: 0;
}
.home-code-comparison pre {
font-size: 0.85rem;
line-height: 1.9;
}
.code-key {
color: var(--accent);
background: #e4ecf5;
border-radius: 2px;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
}
.pan-examples {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 2.5rem;
margin-top: 1.8rem;
padding: 1.4rem 1.6rem;
border: 1px solid var(--line);
border-radius: 5px;
}
.pan-example {
min-width: 0;
text-align: center;
}
.pan-label,
.pan-value,
.pan-meaning {
display: block;
}
.pan-label {
color: var(--ink);
font-size: 0.9rem;
font-weight: 600;
}
.pan-position {
position: relative;
height: 2rem;
margin-block: 0.6rem;
}
.pan-position::before {
content: "";
position: absolute;
top: calc(50% - 1px);
left: 0;
right: 0;
height: 2px;
background: var(--line);
}
.pan-position i {
position: absolute;
top: calc(50% - 5px);
left: calc(5px + (100% - 10px) * var(--position));
width: 10px;
height: 10px;
transform: translateX(-50%);
border-radius: 50%;
background: var(--accent);
}
.pan-value {
font-size: 0.9rem;
}
.pan-meaning {
margin-top: 0.25rem;
color: var(--muted);
font-size: 0.8rem;
}
.home-calculation figcaption {
margin-top: 0.8rem;
color: var(--muted);
font-size: 0.8rem;
}
.home-analysis-work {
max-width: 760px;
margin: 1.5rem 0 0;
color: var(--muted);
}
.home-agent-grid,
.home-try-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr);
gap: 3.5rem;
align-items: start;
}
.home-reassurance h2 {
font-size: clamp(1.75rem, 3vw, 2.2rem);
}
.home-no {
margin: 1.2rem 0;
font-size: clamp(4.5rem, 8vw, 6.5rem);
font-weight: 650;
letter-spacing: -0.06em;
line-height: 1;
}
.home-reassurance > :last-child,
.home-try-grid p {
color: var(--muted);
}
.home-analysis-terminal {
margin: 0 0 0.9rem;
}
.terminal-target {
margin: 1rem 1.4rem 0;
color: #bdc8d4;
font-size: 0.75rem;
}
.agent-reply {
padding: 1.4rem;
background: var(--page);
color: var(--ink);
}
.agent-reply .reply-label {
color: var(--accent);
font-size: 0.8rem;
font-weight: 600;
}
.agent-reply > :last-child {
margin-bottom: 0;
}
.home-evidence {
margin-block: 2rem 1.2rem;
}
.home-check {
max-width: 800px;
margin: 0;
color: var(--muted);
font-size: 0.875rem;
}
.home-try-grid {
grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}
.home-setup .agent-terminal {
margin-block: 1rem;
}
.home-setup .code-inline {
margin-block: 0.5rem 0.8rem;
}
.home-setup > .caption {
margin-bottom: 0;
}
.code-block {
margin-block: 1.3rem;
border: 1px solid var(--line);
@@ -1062,7 +1218,608 @@ pre code {
border: 0;
}
.home-start-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 3.5rem;
align-items: center;
}
.home-start-grid h1 {
font-size: clamp(2.8rem, 5vw, 4.2rem);
}
.home-start-grid .home-setup h2 {
font-size: 1.3rem;
letter-spacing: -0.02em;
margin-bottom: 0.7rem;
}
.home-start-grid .home-setup > p {
font-size: 0.9rem;
color: var(--muted);
}
.home-question {
margin-block: 0 1.8rem;
color: var(--muted);
}
.home-question strong {
color: var(--ink);
font-weight: 500;
}
.home-purpose {
max-width: 850px;
margin-bottom: 2rem;
color: var(--muted);
}
.prose-highlight {
padding: 0.04em 0.16em;
border-radius: 2px;
background: #e4ecf5;
color: var(--accent);
font-weight: 600;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
}
.case-brief {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
gap: 2.5rem;
margin: 0 0 2rem;
padding-block: 1.2rem;
border-top: 1px solid var(--line);
border-bottom: 1px solid var(--line);
}
.case-brief dt,
.finding-label {
margin-bottom: 0.45rem;
font-size: 0.8rem;
font-weight: 600;
color: var(--accent);
}
.case-brief dd {
margin: 0;
color: var(--muted);
font-size: 0.95rem;
}
.case-brief dd strong {
color: var(--ink);
}
.rea-finding {
margin-bottom: 1.4rem;
padding-left: 1rem;
border-left: 2px solid var(--accent);
}
.rea-finding > :last-child {
margin: 0;
font-size: 0.95rem;
color: var(--muted);
}
.rea-finding strong {
color: var(--ink);
}
.home-role-comparison {
display: grid;
grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
gap: 0 2rem;
margin: 0;
}
.comparison-question {
margin-block: 1.8rem 1.2rem;
font-size: 1.05rem;
color: var(--muted);
}
.comparison-question strong {
color: var(--ink);
}
.comparison-label {
padding-bottom: 0.8rem;
border-bottom: 1px solid var(--line);
font-size: 0.875rem;
font-weight: 600;
}
.agent-investigation > .comparison-label {
color: var(--accent);
}
.expert-step-selector {
grid-template-columns: repeat(3, minmax(0, 1fr));
margin-block: 1.2rem 1rem;
}
.expert-step-selector button {
min-height: 44px;
padding: 0.6rem 0.4rem;
font-size: 0.75rem;
}
.expert-step-selector button span {
font-size: 0.7rem;
}
.expert-analysis-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 0.52fr);
align-items: start;
gap: 0.9rem;
}
.expert-assembly {
min-width: 0;
margin: 0;
}
.expert-assembly .code-header {
padding: 0.7rem 0.8rem;
font-size: 0.7rem;
cursor: pointer;
list-style: none;
}
.expert-assembly summary::-webkit-details-marker {
display: none;
}
.expert-assembly summary:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
.assembly-disclosure::after {
content: "Show +";
color: var(--accent);
white-space: nowrap;
}
.expert-assembly[open] .assembly-disclosure::after {
content: "Hide −";
}
.expert-assembly pre {
margin: 0;
padding: 0.8rem;
font-size: 0.7rem;
line-height: 1.6;
}
.assembly-omission {
color: var(--muted);
}
.expert-reasoning {
min-width: 0;
padding-top: 0.1rem;
}
.expert-thought {
position: relative;
padding: 1rem 0.9rem;
border: 1px solid var(--line);
border-radius: 16px;
background: var(--page);
}
.expert-thought + .expert-thought {
margin-top: 1rem;
}
.expert-thought::before,
.expert-thought::after {
content: "";
position: absolute;
border: 1px solid var(--line);
border-radius: 50%;
background: var(--page);
}
.expert-thought::before {
bottom: -18px;
right: 38px;
width: 12px;
height: 12px;
}
.expert-thought::after {
bottom: -30px;
right: 47px;
width: 6px;
height: 6px;
}
.expert-thought > p {
margin: 0;
font-size: 0.85rem;
line-height: 1.65;
}
.expert-thought > .thought-label {
margin-bottom: 0.6rem;
color: var(--accent);
font-size: 0.7rem;
font-weight: 600;
}
.expert-thought > .expert-task {
margin-top: 0.8rem;
color: var(--muted);
font-size: 0.75rem;
}
.expert-facts {
display: grid;
gap: 0.45rem;
margin: 0.9rem 0 0;
padding-top: 0.8rem;
border-top: 1px solid var(--line);
font-size: 0.7rem;
}
.expert-facts div {
display: flex;
justify-content: space-between;
gap: 0.5rem;
}
.expert-facts dt {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.expert-facts dd {
margin: 0;
color: var(--accent);
}
.expert-rule {
display: grid;
gap: 0.3rem;
margin-top: 0.9rem;
padding-top: 0.8rem;
border-top: 1px solid var(--line);
font-size: 0.75rem;
}
.expert-rule strong {
color: var(--accent);
font-size: 1.4rem;
}
.expert-illustration {
display: block;
width: 120px;
height: 90px;
margin: 2rem 0 0 auto;
}
.expert-caption {
margin: 0.5rem 0 0;
color: var(--muted);
font-size: 0.65rem;
text-align: right;
}
.manual-work-summary {
margin: 1rem 0 0;
color: var(--muted);
font-size: 0.85rem;
}
.manual-work-summary strong {
font-weight: 500;
}
.agent-one-prompt {
margin: 1.2rem 0 0.3rem;
color: var(--accent);
font-size: clamp(1.8rem, 3vw, 2.5rem);
font-weight: 600;
letter-spacing: -0.045em;
}
.agent-intro {
margin: 0 0 1.2rem;
color: var(--muted);
font-size: 0.9rem;
}
.agent-percent-rule {
display: grid;
justify-items: start;
gap: 0.2rem;
margin-top: 0.9rem;
color: var(--accent);
}
.agent-percent-rule code {
color: var(--ink);
}
.agent-percent-rule > span {
margin-left: 0.4rem;
color: var(--muted);
}
.agent-percent-rule strong {
font-size: 1.2rem;
}
.agent-evidence-roles {
display: grid;
gap: 1rem;
margin: 1.2rem 0 0;
}
.agent-evidence-roles dt {
margin-bottom: 0.25rem;
color: var(--accent);
font-size: 0.75rem;
font-weight: 600;
}
.agent-evidence-roles dd {
margin: 0;
color: var(--muted);
font-size: 0.85rem;
}
.agent-investigation-note {
color: var(--muted);
font-size: 0.875rem;
}
.home-role-comparison figcaption {
grid-column: 1 / -1;
margin-top: 1.2rem;
font-size: 0.8rem;
color: var(--muted);
}
.home-example-grid {
display: grid;
grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
align-items: start;
gap: 3rem;
}
.percent-figure,
.dino-demo {
min-width: 0;
margin: 0;
padding: 1.5rem;
border: 1px solid var(--line);
border-radius: 5px;
}
.percent-operation,
.percent-controls,
.dino-buttons {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.percent-operation button,
.percent-controls button,
.dino-buttons button {
min-height: 44px;
border: 1px solid var(--line);
border-radius: 4px;
padding: 0.5rem 0.8rem;
font: inherit;
font-size: 0.85rem;
color: var(--ink);
background: var(--page);
cursor: pointer;
}
.percent-operation button[aria-pressed="true"] {
color: var(--accent);
border-color: var(--accent);
background: #edf2f8;
}
.percent-display {
padding: 1.2rem;
margin-block: 1rem;
border-radius: 4px;
background: var(--soft);
text-align: right;
font-variant-numeric: tabular-nums;
}
.percent-expression {
display: block;
min-height: 1.5rem;
color: var(--muted);
font-size: 0.9rem;
}
.percent-display strong {
font-size: 3rem;
font-weight: 500;
letter-spacing: -0.04em;
}
.percent-controls .percent-key {
min-width: 68px;
font-size: 1.25rem;
color: var(--accent);
border-color: #bbcce0;
}
.percent-controls button:disabled {
opacity: 0.45;
cursor: default;
}
.percent-controls .percent-reset {
margin-left: auto;
border-color: transparent;
color: var(--muted);
}
.percent-status {
min-height: 3rem;
margin-top: 1rem;
font-size: 0.9rem;
}
.percent-figure figcaption,
.dino-demo figcaption {
margin-top: 0.8rem;
color: var(--muted);
font-size: 0.8rem;
}
.percent-explanation h3 {
font-size: 1.2rem;
}
.percent-explanation > p {
color: var(--muted);
}
.percent-rules {
margin-bottom: 0;
}
.percent-rules > div {
padding-block: 0.55rem;
}
.percent-rules dt {
font-size: 0.8rem;
color: var(--muted);
margin-bottom: 0.25rem;
}
.percent-rules dd {
margin: 0;
font-size: 0.9rem;
}
.percent-rules dd strong,
.percent-rules dd code {
display: block;
}
.percent-rules dd strong {
margin-bottom: 0.25rem;
font-weight: 500;
}
.home-evidence-details {
margin-top: 2rem;
padding-block: 1rem;
border-top: 1px solid var(--line);
border-bottom: 1px solid var(--line);
}
.home-evidence-details > summary {
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
}
.home-evidence-details[open] > summary {
margin-bottom: 1.5rem;
}
.calculator-trace {
margin-block: 1.5rem;
}
.dino-example-grid {
grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
gap: 2.5rem;
}
.dino-stage {
overflow: hidden;
margin-block: 0.8rem;
background: var(--soft);
border-radius: 4px;
color: var(--muted);
}
.dino-stage canvas,
.dino-fallback {
display: block;
width: 100%;
height: auto;
}
.dino-stage canvas {
touch-action: manipulation;
}
.dino-buttons .button {
background: var(--ink);
border-color: var(--ink);
color: white;
}
.dino-controls {
display: grid;
gap: 1.2rem;
}
.dino-speed-label {
display: grid;
grid-template-columns: 1fr auto;
gap: 0.5rem;
font-size: 0.875rem;
}
.dino-speed-label output {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
font-variant-numeric: tabular-nums;
color: var(--accent);
}
.dino-speed-label input {
grid-column: 1 / -1;
width: 100%;
margin: 0;
min-height: 30px;
accent-color: var(--accent);
}
.dino-auto-label {
display: flex;
align-items: center;
gap: 0.6rem;
min-height: 36px;
font-size: 0.8rem;
color: var(--muted);
}
.dino-auto-label input {
width: 17px;
height: 17px;
flex-shrink: 0;
accent-color: var(--accent);
}
.dino-status {
min-height: 2.6rem;
margin: 1rem 0 0;
font-size: 0.8rem;
color: var(--muted);
}
.dino-rule {
color: var(--muted);
font-size: 0.95rem;
}
.dino-rule strong {
color: var(--ink);
}
.dino-loop {
margin-top: 2rem;
}
.dino-lab-demo {
margin-block: 2rem;
}
.dino-lab-demo .dino-stage {
margin-block: 1.5rem;
}
.speed-check-table td:last-child,
.speed-check-table th:last-child {
text-align: right;
}
[hidden] {
display: none !important;
}
@media (max-width: 850px) {
.home-start-grid,
.home-role-comparison,
.home-example-grid {
grid-template-columns: minmax(0, 1fr);
gap: 2rem;
}
.home-start-grid .home-setup {
max-width: 620px;
}
.home-start-grid h1 {
font-size: clamp(2.7rem, 9vw, 4.65rem);
}
.home-role-comparison figcaption {
margin-top: 0;
}
}
@media (max-width: 640px) {
.expert-analysis-grid {
grid-template-columns: minmax(0, 1fr);
}
.expert-reasoning {
display: grid;
grid-template-columns: minmax(0, 1fr) 88px;
column-gap: 0.75rem;
align-items: end;
}
.expert-thought::before {
right: -18px;
bottom: 42px;
}
.expert-thought::after {
right: -30px;
bottom: 36px;
}
.expert-illustration {
width: 88px;
height: 66px;
margin: 0;
}
.expert-caption {
grid-column: 1 / -1;
text-align: left;
}
.expert-step-selector button {
font-size: 0.7rem;
}
.expert-step-selector button span {
display: block;
margin: 0 0 0.2rem;
}
.case-brief {
grid-template-columns: minmax(0, 1fr);
gap: 1.2rem;
}
.home-hero {
padding-block: 2.8rem;
}
.percent-figure,
.dino-demo {
padding: 1.1rem;
}
}
@media (max-width: 850px) {
.home-agent-grid,
.home-try-grid {
grid-template-columns: 1fr;
gap: 2rem;
}
.home-reassurance {
max-width: 600px;
}
.brand-caption {
display: none;
}
@@ -1096,6 +1853,31 @@ pre code {
}
@media (max-width: 640px) {
.home-definition {
grid-template-columns: 1fr;
gap: 0.8rem;
}
.pan-examples {
grid-template-columns: 1fr;
gap: 1.3rem;
padding: 1.2rem;
}
.pan-example {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
column-gap: 1rem;
text-align: left;
}
.pan-position {
grid-column: 2;
grid-row: 1;
margin: 0;
height: 1.6rem;
}
.pan-value,
.pan-meaning {
grid-column: 1 / -1;
}
.back-to-top {
right: calc(1rem + env(safe-area-inset-right, 0px));
bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
+334
View File
@@ -0,0 +1,334 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Dinosaur speed lab — REA</title>
<meta
name="description"
content="Read the dinosaur game’s speed rule with REA, rebuild it, then change the speed and play."
/>
<meta name="theme-color" content="#ffffff" />
<link rel="icon" href="../../assets/favicon.svg" type="image/svg+xml" />
<link rel="stylesheet" href="../../assets/styles.css" />
<script src="../../assets/main.js" defer></script>
<script type="module" src="../../assets/dino-demo.js"></script>
</head>
<body id="top">
<a class="skip-link" href="#main">Skip to content</a>
<header class="site-header">
<div class="container header-inner">
<a class="brand" href="../../" aria-label="REA home"
><span class="brand-name">REA</span
><span class="brand-caption">Reverse Engineer Anything</span></a
>
<nav class="navigation" aria-label="Main navigation">
<a href="../../showcase/">Showcases</a
><a class="nav-start" href="../../get-started/">Get started</a
><a href="../../guides/">Guides</a><a href="../../faq/">FAQ</a>
</nav>
<a
class="nav-github"
href="https://github.com/morluto/rea"
aria-label="REA on GitHub"
title="REA on GitHub"
>
<svg
width="22"
height="22"
viewBox="0 0 16 16"
aria-hidden="true"
focusable="false"
>
<path
fill="currentColor"
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"
/>
</svg>
<span class="nav-github-count" hidden aria-hidden="true"></span>
</a>
</div>
</header>
<main id="main" class="container">
<div class="page-heading">
<p class="breadcrumb">
<a href="../../">Home</a><span>/</span>Dinosaur speed lab
</p>
<p class="eyebrow">Inspect → rebuild → change</p>
<h1>Rebuild the dinosaur’s speed rule.</h1>
<p class="lede">
To recreate the game’s acceleration, first find the rule that controls
its speed. <strong>REA returned the running script;</strong>
we used its rule to build this mini-game with
<mark class="prose-highlight">adjustable speed.</mark>
</p>
</div>
<div class="article-layout">
<nav class="contents" aria-label="On this page">
<p>On this page</p>
<ul>
<li><a href="#play">Play and change the speed</a></li>
<li><a href="#rule">Read the recovered rule</a></li>
<li><a href="#check">Check the reconstruction</a></li>
<li><a href="#inspect">Try the analysis</a></li>
</ul>
</nav>
<article class="article" aria-label="Dinosaur speed reconstruction">
<section class="article-section" id="play">
<h2>Play and change the speed</h2>
<p>
Press Play, then jump over the cactus. Move the speed slider to
try a slower or faster game; it switches to a fixed speed. Select
the recovered rule to start at 6 and gradually accelerate again.
</p>
<figure class="dino-demo dino-lab-demo" data-dino-demo>
<p class="figure-title">Play the reconstruction</p>
<div class="dino-stage">
<svg
class="dino-fallback"
viewBox="0 0 600 180"
role="img"
aria-label="A small dinosaur running toward a cactus. Recovered speed: starts at 6, increases by 0.001 per update while below 13."
>
<path
d="M0 150H600 M55 113v-30h17V65h27v24H85v17H72v16H62v13h-7v-22m-5-8v-8h-8v-9h-6v22h19m14 15v15h8v-7h-4v-8 M420 150v-48h10v48m-10-15h-12v-22h7v15h5m10-4h12v-22h-7v15h-5"
fill="currentColor"
/>
<text
x="300"
y="65"
text-anchor="middle"
fill="currentColor"
font-size="18"
>
6 → 10 → 13
</text>
</svg>
<canvas
width="600"
height="180"
tabindex="0"
aria-label="Dinosaur mini-game. Use the Jump button or press Space while the game is focused."
hidden
></canvas>
</div>
<div class="dino-controls" hidden>
<div class="dino-buttons">
<button class="button" type="button" data-dino-start>
Play
</button>
<button type="button" data-dino-jump>Jump ↑</button>
<button type="button" data-dino-reset>Restart</button>
</div>
<label class="dino-speed-label"
>Speed <output data-dino-speed>6.0</output
><input
type="range"
min="2"
max="18"
step="0.1"
value="6"
data-dino-slider
/></label>
<label class="dino-auto-label"
><input type="checkbox" data-dino-auto checked /> Use the
recovered acceleration rule</label
>
</div>
<p class="dino-status" data-dino-status role="status">
Original rule: start at 6, then increase toward 13.
</p>
<figcaption>
Move the slider to set your own speed. Space or Jump clears a
cactus.
</figcaption>
<noscript
><p class="caption">
Enable JavaScript to play the reconstruction. The code and
explanation above remain readable.
</p></noscript
>
</figure>
</section>
<section class="article-section" id="rule">
<h2>Read the script REA returned</h2>
<p>
We inspected
<a href="https://wayou.github.io/t-rex-runner/"
>wayou’s Chromium-derived browser edition</a
>
with REA. It returned the loaded <code>index.js</code>, including
this branch in the game’s update function:
</p>
<div class="code-block">
<div class="code-header">
<span>REA · selected script source</span>
</div>
<pre><code>if (this.currentSpeed &lt; this.config.MAX_SPEED) {
this.currentSpeed += this.config.ACCELERATION;
}</code></pre>
</div>
<p>
The settings are <code>SPEED: 6</code>,
<code>ACCELERATION: 0.001</code> and <code>MAX_SPEED: 13</code>.
The game runs this branch on an update without a collision.
</p>
<h3>Use the same rule in the new game</h3>
<div class="code-block">
<div class="code-header">
<span>Reconstruction · dino-speed.js</span
><button
class="copy-button"
type="button"
data-copy="lab-speed-rule"
aria-label="Copy reconstructed speed rule"
>
Copy
</button>
</div>
<pre><code id="lab-speed-rule">function advanceSpeed(speed) {
return speed &lt; 13 ? speed + 0.001 : speed;
}</code></pre>
</div>
<p>
The mini-game uses this function for automatic acceleration.
Moving the slider supplies a fixed speed instead. Drawing, jump
physics and rectangle collision checks are new code for this
teaching game; its simulation advances at 60 updates per second.
</p>
<p>
<a href="../../assets/dino-speed.js" download
>Download the speed rule</a
>
· <a href="../../assets/dino-demo.js">Read the game code</a>
</p>
</section>
<section class="article-section" id="check">
<h2>Check the reconstruction</h2>
<p>
We called the original game’s update function with obstacles and
automatic scheduling disabled. Compare those recorded speeds with
a replay of the recovered rule.
</p>
<div class="table-scroll">
<table class="speed-check-table">
<thead>
<tr>
<th>Updates</th>
<th>Original game</th>
<th>Reconstructed rule</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>6.000</td>
<td data-speed-updates="0">6.000</td>
</tr>
<tr>
<td>1,000</td>
<td>7.000</td>
<td data-speed-updates="1000">7.000</td>
</tr>
<tr>
<td>4,000</td>
<td>10.000</td>
<td data-speed-updates="4000">10.000</td>
</tr>
<tr>
<td>10,000</td>
<td>13.001</td>
<td data-speed-updates="10000">13.001</td>
</tr>
</tbody>
</table>
</div>
<button class="button" type="button" data-speed-check hidden>
Run the speed check
</button>
<p class="caption" data-speed-check-status role="status">
Values rounded to three decimals. The branch checks before adding,
so the final increment can take speed just above 13.
</p>
</section>
<section class="article-section" id="inspect">
<h2>Try the analysis yourself</h2>
<ol>
<li>
<a href="../../get-started/">Set up REA</a> with your coding
agent.
</li>
<li>
Follow the
<a href="../../guides/browser/#prepare"
>browser connection steps</a
>, using <code>https://wayou.github.io/t-rex-runner/</code> as
the page URL.
</li>
<li>
Give your agent the page URL and local debugging endpoint, then
copy this prompt.
</li>
</ol>
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Your coding agent</span
><button
class="copy-button"
type="button"
data-copy="lab-analysis-prompt"
aria-label="Copy dinosaur analysis prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="lab-analysis-prompt"
>Use REA to inspect this dinosaur game. Why does it get
faster? Show the speed rule, then build a small version with
an adjustable speed.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<p>
Ask a follow-up:
<strong
>“Where is jump height calculated? Add a jump-height control to
the new version.”</strong
>
</p>
<p class="caption">
Source:
<a
href="https://github.com/wayou/t-rex-runner/blob/5455bfa408ec6b707c7300ff194b7390733a766d/index.js#L565-L571"
>inspected speed code</a
>, Chromium Authors.
<a href="../../assets/licenses/dinosaur.txt"
>Copyright and BSD license</a
>. REA 4.1.0 inspected the running HTTP edition in Chrome 150.
</p>
</section>
</article>
</div>
</main>
<footer class="site-footer">
<div class="container footer-inner">
<p>REA · Reverse Engineer Anything</p>
<div class="footer-links">
<a href="https://github.com/morluto/rea">Source</a
><a href="https://github.com/morluto/rea/blob/main/LICENSE"
>MIT license</a
><a href="https://discord.gg/GkcryMnJDM">Community</a>
</div>
</div>
</footer>
<p class="sr-only" id="copy-status" role="status" aria-live="polite"></p>
<a class="back-to-top" href="#top" aria-label="Back to top"
><span aria-hidden="true">↑</span> Top</a
>
</body>
</html>
@@ -0,0 +1,371 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Your first investigation — REA</title>
<meta
name="description"
content="Try REA on a small Notes app. Set up your agent, ask where exported notes go, and check the CSV formatter with a sample title."
/>
<meta name="theme-color" content="#ffffff" />
<link rel="icon" href="../assets/favicon.svg" type="image/svg+xml" />
<link rel="stylesheet" href="../assets/styles.css" />
<script src="../assets/main.js" defer></script>
</head>
<body id="top">
<a class="skip-link" href="#main">Skip to content</a>
<header class="site-header">
<div class="container header-inner">
<a class="brand" href="../" aria-label="REA home"
><span class="brand-name">REA</span
><span class="brand-caption">Reverse Engineer Anything</span></a
>
<nav class="navigation" aria-label="Main navigation">
<a href="../showcase/">Showcases</a
><a class="nav-start" href="../get-started/">Get started</a
><a href="../guides/">Guides</a><a href="../faq/">FAQ</a>
</nav>
<a
class="nav-github"
href="https://github.com/morluto/rea"
aria-label="REA on GitHub"
title="REA on GitHub"
>
<svg
width="22"
height="22"
viewBox="0 0 16 16"
aria-hidden="true"
focusable="false"
>
<path
fill="currentColor"
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"
/>
</svg>
<span class="nav-github-count" hidden aria-hidden="true"></span>
</a>
</div>
</header>
<main id="main" class="container">
<div class="page-heading">
<p class="breadcrumb">
<a href="../">Home</a> / Your first investigation
</p>
<h1>Find out where<br />exported notes go.</h1>
<p class="lede">
Use REA to inspect a small app, follow its Export notes button and
check one detail yourself.
</p>
<p class="page-meta">
A supplied example · Node.js and npm · Your coding agent
</p>
</div>
<div class="article-layout">
<nav class="contents" aria-label="On this page">
<p>In this exercise</p>
<ul>
<li><a href="#setup">1. Set up</a></li>
<li><a href="#ask">2. Ask about export</a></li>
<li><a href="#answer">3. Follow the answer</a></li>
<li><a href="#check">4. Check a prediction</a></li>
<li><a href="#next">5. Ask another question</a></li>
</ul>
</nav>
<article class="article" aria-label="Your first REA investigation">
<section class="article-section" id="setup">
<h2>1. Connect your agent to REA</h2>
<p>
Use a coding agent such as Claude Code, Codex or Cursor. You’ll
need Node.js and npm; the
<a href="../get-started/">setup guide lists supported versions</a
>.
</p>
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Your coding agent</span
>
<button
class="copy-button"
type="button"
data-copy="first-install-prompt"
aria-label="Copy REA installation prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="first-install-prompt"
>Install REA and connect it to this coding agent using npx
rea-agents@latest setup. Show me the setup plan for approval,
then verify the installation.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<p class="caption">Or run this command in your terminal:</p>
<div class="code-block code-inline">
<code id="first-setup-command">npx rea-agents@latest setup</code>
<button
class="copy-button"
type="button"
data-copy="first-setup-command"
aria-label="Copy setup command"
>
Copy
</button>
</div>
<p>
Review the plan, approve the setup, then restart your agent.
Already connected? Continue below.
</p>
</section>
<section class="article-section" id="ask">
<h2>2. Ask where the CSV is written</h2>
<p>
The example is a six-file Electron app with an
<strong>Export notes</strong> button. Your agent can inspect its
code without installing or launching Electron.
</p>
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Your coding agent</span
>
<button
class="copy-button"
type="button"
data-copy="first-analysis-prompt"
aria-label="Copy Notes investigation prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="first-analysis-prompt"
>Download https://rea.tools/examples/notes-example.zip into a
new example folder and unpack it. Use REA to find what happens
when I click Export notes. Show where notes.csv is written,
which fields it contains, and the relevant files and
lines.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<p>
Your agent downloads the files and gives the unpacked folder to
REA for inspection.
</p>
<p>
<a
class="button"
href="../examples/notes-example.zip"
download="notes-example.zip"
>Download example ZIP</a
>
</p>
<p class="caption">
If your agent can’t download files, unzip this archive yourself.
Give it the path to the <code>notes-example</code> folder and the
same export question.
</p>
</section>
<section class="article-section" id="answer">
<h2>3. Follow the answer back to the code</h2>
<p>Look for a short explanation with file and line references:</p>
<blockquote class="prompt">
<p>
The button sends a <code>notes:export</code> message. The main
process formats the notes as CSV and writes
<code>notes.csv</code> in the user’s Downloads folder. The
columns are <code>id</code> and <code>title</code>.
</p>
</blockquote>
<figure class="workflow-figure">
<p class="figure-title">From the button to the file writer</p>
<ol class="flow-steps">
<li>
<span class="flow-label">Page · renderer.js</span
><span class="flow-node">Export notes</span
><span class="flow-note"
>Calls <code>notes.exportCsv()</code>.</span
>
</li>
<li>
<span class="flow-label">Bridge · preload.js</span
><span class="flow-node"><code>notes:export</code></span
><span class="flow-note"
>Sends a named message to the main process.</span
>
</li>
<li>
<span class="flow-label">Handler · main.js</span
><span class="flow-node">Write notes.csv</span
><span class="flow-note"
>Calls the formatter in <code>csv.js</code> and writes the
file.</span
>
</li>
</ol>
<figcaption>
REA’s static analysis pairs the message with its handler. The
destination is read from code.
</figcaption>
</figure>
<div class="code-block">
<div class="code-header">
<span>main.js · lines 8–12</span
><a href="../examples/notes-electron/main.js">Source</a>
</div>
<pre><code>ipcMain.handle("notes:export", () =&gt; {
const destination = path.join(app.getPath("downloads"), "notes.csv");
writeFileSync(destination, toCsv(notes), "utf8");
return destination;
});</code></pre>
</div>
<p>
The file path, formatter and write call are together in this
handler. Ask your agent to show these lines if its answer leaves
them out.
</p>
<p>
<a href="../guides/javascript/#follow"
>See the full code trace and recorded REA result</a
>.
</p>
</section>
<section class="article-section" id="check">
<h2>4. Check a prediction</h2>
<p>
A comma separates CSV columns. What happens when a note title
itself contains a comma or quotation marks?
</p>
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Your coding agent</span
>
<button
class="copy-button"
type="button"
data-copy="first-check-prompt"
aria-label="Copy CSV check prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="first-check-prompt"
>Predict the CSV for a note with id 1 and title Hello, "REA".
Then run the example’s toCsv formatter with Node.js to check
it. Show the prediction and actual output.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<div class="code-block">
<div class="code-header">
<span>Expected formatter output</span>
</div>
<pre><code>id,title
1,"Hello, ""REA"""</code></pre>
</div>
<p>
The title stays in one quoted field; each quotation mark is
doubled. This checks the formatter directly with Node.js.
</p>
<details class="evidence-details">
<summary>Run the check yourself</summary>
<p>
Open a terminal in the unpacked
<code>notes-example</code> folder:
</p>
<div class="code-block">
<div class="code-header">
<span>Node.js · CSV formatter</span
><button
class="copy-button"
type="button"
data-copy="first-check-command"
aria-label="Copy formatter check command"
>
Copy
</button>
</div>
<pre><code id="first-check-command">node &lt;&lt;'JS'
const { toCsv } = require('./csv.js');
process.stdout.write(toCsv([{ id: 1, title: 'Hello, "REA"' }]));
JS</code></pre>
</div>
<p class="caption">
This command uses a shell with here-document support, such as
Bash or Zsh. Your agent can run the same JavaScript in your
platform’s shell.
</p>
</details>
</section>
<section class="article-section" id="next">
<h2>5. Ask another question</h2>
<p>Try a follow-up in the same conversation:</p>
<blockquote class="prompt">
<p>
What happens if the file can’t be written? Follow the error back
to the page.
</p>
</blockquote>
<p>
Or give your agent an app of your own and ask about one button,
file or behavior.
</p>
<ul class="reading-list">
<li>
<a href="../showcase/notion/">How Notion copies text and HTML</a
><span
>Follow a clipboard feature in a packaged Electron app.</span
>
</li>
<li>
<a href="../showcase/dx-ball/"
>How DX-Ball calculates sound panning</a
><span
>Read the original instructions and the reconstruction’s
checks.</span
>
</li>
<li>
<a href="../faq/#troubleshooting"
>Troubleshoot setup or analysis</a
><span
>Update REA and check the connection if you get stuck.</span
>
</li>
</ul>
</section>
</article>
</div>
</main>
<footer class="site-footer">
<div class="container footer-inner">
<p>REA · Reverse Engineer Anything</p>
<div class="footer-links">
<a href="https://github.com/morluto/rea">Source</a
><a href="https://github.com/morluto/rea/blob/main/LICENSE"
>MIT license</a
><a href="https://discord.gg/GkcryMnJDM">Community</a>
</div>
</div>
</footer>
<p class="sr-only" id="copy-status" role="status" aria-live="polite"></p>
<a class="back-to-top" href="#top" aria-label="Back to top"
><span aria-hidden="true">↑</span> Top</a
>
</body>
</html>
+767 -73
View File
@@ -12,6 +12,8 @@
<link rel="icon" href="assets/favicon.svg" type="image/svg+xml" />
<link rel="stylesheet" href="assets/styles.css" />
<script src="assets/main.js" defer></script>
<script src="assets/home.js" defer></script>
<script type="module" src="assets/dino-demo.js"></script>
</head>
<body id="top">
<a class="skip-link" href="#main">Skip to content</a>
@@ -50,55 +52,781 @@
</div>
</header>
<main id="main">
<section class="container hero">
<p class="eyebrow">Software analysis · CLI &amp; MCP</p>
<h1>Find out how<br />software works.</h1>
<p class="lede">
Use REA with your coding agent to inspect binaries, trace application
code and observe runtime behavior.
</p>
<div class="actions">
<a class="button" href="get-started/">Get started</a>
<a class="text-link" href="showcase/">Explore the case studies</a>
</div>
<div class="hero-command">
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Your coding agent</span
>
<section class="container hero home-hero">
<div class="home-start-grid">
<div>
<p class="eyebrow">Reverse engineering, with your coding agent</p>
<h1>Find out how<br />software works.</h1>
<p class="lede">
REA gives your agent the tools to inspect a program and explain
what it does.
</p>
<div class="actions">
<a class="button" href="#what-is-re">See how REA works ↓</a>
<a class="text-link" href="get-started/">Setup guide</a>
</div>
</div>
<div class="home-setup">
<h2>Set up REA</h2>
<p>Copy this into your coding agent:</p>
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Your coding agent</span
>
<button
class="copy-button"
type="button"
data-copy="home-install-prompt"
aria-label="Copy REA installation prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="home-install-prompt"
>Install REA and connect it to this coding agent using npx
rea-agents@latest setup. Show me the setup plan for approval,
then verify the installation.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<p class="caption">Or run this in your terminal:</p>
<div class="code-block code-inline">
<code id="setup-command">npx rea-agents@latest setup</code>
<button
class="copy-button"
type="button"
data-copy="home-install-prompt"
aria-label="Copy REA installation prompt"
data-copy="setup-command"
aria-label="Copy setup command"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="home-install-prompt"
>Install REA and connect it to this coding agent using npx
rea-agents@latest setup. Show me the setup plan for approval,
then verify the installation.</span
><span class="terminal-cursor" aria-hidden="true"></span>
<p class="caption">
Approve the setup plan, then restart your agent.
</p>
</div>
<p class="caption">Or run this command in your terminal:</p>
<div class="code-block code-inline">
<code id="setup-command">npx rea-agents@latest setup</code>
<button
class="copy-button"
type="button"
data-copy="setup-command"
aria-label="Copy setup command"
>
Copy
</button>
</div>
</section>
<section class="section" id="what-is-re">
<div class="container">
<div class="home-definition">
<h2>What is reverse engineering?</h2>
<p class="lede">
Finding out how software works by
<strong>examining the program itself.</strong>
</p>
</div>
<p class="home-purpose">
The goal: understand a feature well enough to
<mark class="prose-highlight">explain it</mark>,
<mark class="prose-highlight">change it</mark> or
<mark class="prose-highlight">rebuild it.</mark>
</p>
<p class="comparison-question">
One question:
<strong>why does Calculator give 220 for 200 + 10%?</strong>
</p>
<figure class="home-role-comparison">
<div
class="manual-investigation step-comparison"
data-step-comparison
>
<p class="comparison-label">Before REA · You investigate</p>
<div
class="step-selector expert-step-selector"
role="group"
aria-label="Follow the manual Calculator analysis"
>
<button
type="button"
data-select-step="1"
aria-pressed="true"
aria-controls="expert-assembly expert-reasoning"
>
<span>01</span> Decode branches
</button>
<button
type="button"
data-select-step="2"
aria-pressed="false"
aria-controls="expert-assembly expert-reasoning"
>
<span>02</span> Trace calls
</button>
<button
type="button"
data-select-step="3"
aria-pressed="false"
aria-controls="expert-assembly expert-reasoning"
>
<span>03</span> Recover the rule
</button>
</div>
<div class="expert-analysis-grid">
<details
class="code-block expert-assembly"
data-expert-assembly
open
>
<summary class="code-header">
<span>Original x64 · selected instructions</span>
<span class="assembly-disclosure" aria-hidden="true"></span>
</summary>
<pre><code id="expert-assembly"><span class="code-step is-active" data-step="1">0x180124945: MOV EAX, dword ptr [R13 + 0x18]
0x180124949: CMP EAX, 0x5c
0x18012494c: JZ 0x180124aba
0x180124952: CMP EAX, 0x5b
0x180124955: JZ 0x180124aba</span>
<span class="code-step" data-step="2">0x18012495b: MOV EDX, 0x64
0x180124960: LEA RCX, [RSP + 0x160]
0x180124968: CALL 0x180122650
0x18012496e: LEA RDX, [R13 + 0x160]
0x180124975: LEA RCX, [RSP + 0x78]
0x18012497a: CALL 0x180109720</span>
0x18012497f: MOV RSI, RAX
0x180124982: MOV qword ptr [RSP + 0x28], RAX
<span class="code-step" data-step="2">0x180124987: LEA RDX, [RSP + 0x160]
0x18012498f: MOV RCX, RAX
0x180124992: CALL 0x180123190</span>
<span class="assembly-omission">; … value-copy instructions omitted …</span>
<span class="code-step" data-step="3">0x180124a14: MOV RDX, RDI
0x180124a17: LEA RCX, [RSP + 0xf8]
0x180124a1f: CALL 0x180109720
0x180124a24: LEA R8, [RSP + 0x30]
0x180124a29: MOV RDX, RAX
0x180124a2c: LEA RCX, [RSP + 0xb8]
0x180124a34: CALL 0x180123c10</span></code></pre>
</details>
<aside
class="expert-reasoning"
aria-label="Illustrative expert reasoning"
>
<div
id="expert-reasoning"
aria-live="polite"
aria-atomic="true"
>
<div class="expert-thought" data-step-note="1">
<p class="thought-label">01 · Which branch?</p>
<p>
“<strong>0x5b? 0x5c?</strong> Two jumps to the same
place. Which operators are these?”
</p>
<p class="expert-task">
Look up the command IDs, then label the branch.
</p>
<dl class="expert-facts">
<div>
<dt>0x5b</dt>
<dd>Divide ÷</dd>
</div>
<div>
<dt>0x5c</dt>
<dd>Multiply ×</dd>
</div>
</dl>
</div>
<div class="expert-thought" data-step-note="2">
<p class="thought-label">02 · What do the calls do?</p>
<p>
“100 is clear. The calls are just addresses.
<strong>Which one divides? Which value goes in?</strong
>”
</p>
<p class="expert-task">
Inspect the helpers and trace the stored values.
</p>
<dl class="expert-facts">
<div>
<dt>0x64</dt>
<dd>100</dd>
</div>
<div>
<dt>…123190</dt>
<dd>Divide</dd>
</div>
</dl>
</div>
<div class="expert-thought" data-step-note="3">
<p class="thought-label">03 · What is the rule?</p>
<p>
“This path multiplies by the other input. So
<strong>10% means 10% of 200</strong> after +.”
</p>
<p class="expert-task">
Name the operands and check both operator paths.
</p>
<div class="expert-rule">
<span>200 × 10 / 100</span>
<strong>20</strong>
</div>
</div>
</div>
<img
class="expert-illustration"
src="assets/figures/analyst-thinking.svg"
alt=""
width="160"
height="120"
/>
<p class="expert-caption">Illustrative expert reasoning</p>
</aside>
</div>
<p class="manual-work-summary">
<strong
>You decode the instructions, follow the calls and reconstruct
the calculation.</strong
>
</p>
</div>
<div class="agent-investigation" id="ask-your-agent">
<p class="comparison-label">With REA · You ask your agent</p>
<h3 class="agent-one-prompt">One prompt.</h3>
<p class="agent-intro">
Ask your agent <strong>in plain English.</strong>
</p>
<div class="agent-terminal home-analysis-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Example prompt · Calculator</span
>
<button
class="copy-button"
type="button"
data-copy="home-analysis-prompt"
aria-label="Copy Calculator percentage question"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="home-analysis-prompt"
>Use REA to inspect Windows Calculator. Why does 200 + 10%
give 220?</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
<div class="agent-reply">
<p class="reply-label">
Example answer · based on the findings
</p>
<p>
After +, the % button takes
<strong>a percentage of the first number.</strong>
</p>
<div class="agent-percent-rule">
<code>10% of 200 = 20</code><span aria-hidden="true">↓</span
><strong>200 + 20 = 220</strong>
</div>
</div>
</div>
<dl class="agent-evidence-roles">
<div>
<dt>REA supplies</dt>
<dd>
The handler’s instructions, decompiled code and calls.
</dd>
</div>
<div>
<dt>Your agent explains</dt>
<dd>
Which branch applies, what it calculates and how to rebuild
it.
</dd>
</div>
</dl>
</div>
<figcaption>
Selected assembly from the installed Calculator DLL. The thoughts
and reply illustrate the findings.
<a href="#calculator">See the calculation and sources ↓</a>
</figcaption>
</figure>
</div>
</section>
<section class="section" id="dinosaur">
<div class="container">
<div class="section-heading">
<p class="eyebrow">Example 01 · Chrome’s dinosaur game</p>
<h2>Why does the dinosaur get faster?</h2>
</div>
<dl class="case-brief">
<div>
<dt>Goal</dt>
<dd>
Rebuild the game with
<mark class="prose-highlight">adjustable speed.</mark>
</dd>
</div>
<div>
<dt>Why reverse engineer it?</dt>
<dd>
To reproduce its acceleration, we need
<strong>the rule in the running game</strong>: how fast it
starts, how much it increases and when it stops.
</dd>
</div>
</dl>
<div class="home-example-grid dino-example-grid">
<figure class="dino-demo" data-dino-demo>
<p class="figure-title">Play the reconstruction</p>
<div class="dino-stage">
<svg
class="dino-fallback"
viewBox="0 0 600 180"
role="img"
aria-label="A small dinosaur running toward a cactus. Recovered speed: starts at 6, increases by 0.001 per update while below 13."
>
<path
d="M0 150H600 M55 113v-30h17V65h27v24H85v17H72v16H62v13h-7v-22m-5-8v-8h-8v-9h-6v22h19m14 15v15h8v-7h-4v-8 M420 150v-48h10v48m-10-15h-12v-22h7v15h5m10-4h12v-22h-7v15h-5"
fill="currentColor"
/>
<text
x="300"
y="65"
text-anchor="middle"
fill="currentColor"
font-size="18"
>
6 → 10 → 13
</text>
</svg>
<canvas
width="600"
height="180"
tabindex="0"
aria-label="Dinosaur mini-game. Use the Jump button or press Space while the game is focused."
hidden
></canvas>
</div>
<div class="dino-controls" hidden>
<div class="dino-buttons">
<button class="button" type="button" data-dino-start>
Play
</button>
<button type="button" data-dino-jump>Jump ↑</button>
<button type="button" data-dino-reset>Restart</button>
</div>
<label class="dino-speed-label"
>Speed <output data-dino-speed>6.0</output
><input
type="range"
min="2"
max="18"
step="0.1"
value="6"
data-dino-slider
/></label>
<label class="dino-auto-label"
><input type="checkbox" data-dino-auto checked /> Use the
recovered acceleration rule</label
>
</div>
<p class="dino-status" data-dino-status role="status">
Original rule: start at 6, then increase toward 13.
</p>
<figcaption>
Move the slider to set your own speed. Space or Jump clears a
cactus.
</figcaption>
<noscript
><p class="caption">
Enable JavaScript to play the reconstruction. The code and
explanation above remain readable.
</p></noscript
>
</figure>
<div>
<div class="rea-finding">
<p class="finding-label">REA returned</p>
<p>
<strong>The script actually running in the page.</strong> The
agent reads its update function and speed settings, then uses
that rule in a new game.
</p>
</div>
<div class="agent-terminal home-analysis-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Example prompt · Dinosaur game</span
>
<button
class="copy-button"
type="button"
data-copy="dino-analysis-prompt"
aria-label="Copy dinosaur analysis prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="dino-analysis-prompt"
>Use REA to inspect this dinosaur game. Why does it get
faster? Show the speed rule, then build a small version with
an adjustable speed.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<p class="caption">
Inspected target:
<a href="https://wayou.github.io/t-rex-runner/"
>wayou’s Chromium-derived browser edition</a
>.
</p>
<div class="code-block">
<div class="code-header">
<span>REA · loaded index.js · selected lines</span>
</div>
<pre><code>if (this.currentSpeed &lt; this.config.MAX_SPEED) {
<span class="code-key">this.currentSpeed += this.config.ACCELERATION;</span>
}</code></pre>
</div>
<p class="dino-rule">
<strong>Start at 6.</strong> Add <strong>0.001</strong> each
update without a collision, while speed is below
<strong>13</strong>.
</p>
<a class="text-link" href="examples/dino-lab/"
>Open the speed lab →</a
>
</div>
</div>
<figure class="workflow-figure dino-loop">
<p class="figure-title">What each part does</p>
<ol class="flow-steps">
<li>
<span class="flow-label">01 · REA</span
><span class="flow-node">Read the running game’s script</span
><span class="flow-note"
>Return its actual code and settings to the agent.</span
>
</li>
<li>
<span class="flow-label">02 · Your agent</span
><span class="flow-node">Rebuild the rule, add a control</span
><span class="flow-note"
>Use the recovered acceleration in a small game with a speed
slider.</span
>
</li>
<li>
<span class="flow-label">03 · You</span
><span class="flow-node">Change the speed and play</span
><span class="flow-note"
>Try the original acceleration, then choose your own
pace.</span
>
</li>
</ol>
</figure>
<details class="home-evidence-details">
<summary>
See the script, checks and how to try the analysis
</summary>
<p>
REA inspected the HTTP browser edition through a local debugging
connection and returned the loaded <code>index.js</code>,
including its source and digest.
</p>
<div class="code-block">
<div class="code-header">
<span>Selected settings from the inspected script</span>
</div>
<pre><code>ACCELERATION: 0.001,
MAX_SPEED: 13,
SPEED: 6</code></pre>
</div>
<p>
We called the original game’s update function in a controlled
browser check, with obstacles and automatic scheduling disabled.
After 4,000 updates, speed was 10.0; after 10,000, it was 13.0,
rounded to one decimal.
</p>
<p>
The new mini-game keeps that speed rule. Its drawing, jumping and
collision code are a small teaching implementation.
<a href="examples/dino-lab/">Open the lab</a> to see the new code
and run the same speed check.
</p>
<p>
To inspect the target yourself, follow the
<a href="guides/browser/#prepare">browser connection steps</a>
using
<a href="https://wayou.github.io/t-rex-runner/"
>the dinosaur page</a
>. Give your agent that page URL and your local debugging
endpoint, then copy the prompt above.
</p>
<p class="caption">
<a
href="https://github.com/wayou/t-rex-runner/blob/5455bfa408ec6b707c7300ff194b7390733a766d/index.js#L565-L571"
>Inspected speed code</a
>
·
<a href="assets/licenses/dinosaur.txt"
>Chromium Authors · BSD license</a
>
</p>
</details>
</div>
</section>
<section class="section" id="calculator">
<div class="container">
<div class="section-heading">
<p class="eyebrow">Example 02 · Windows Calculator</p>
<h2>Why does 200 + 10% give 220?</h2>
</div>
<dl class="case-brief">
<div>
<dt>Goal</dt>
<dd>
Explain the result and
<mark class="prose-highlight"
>recreate Calculator’s % rule.</mark
>
</dd>
</div>
<div>
<dt>Why reverse engineer it?</dt>
<dd>
The same button uses
<strong>different rules after + and ×.</strong> We inspect the
installed app to find which number the percentage is applied to.
</dd>
</div>
</dl>
<div class="home-example-grid">
<figure class="percent-figure" data-percent-demo>
<p class="figure-title">Try the calculation</p>
<div
class="percent-operation"
role="group"
aria-label="Choose the calculation"
hidden
>
<button
type="button"
data-percent-operation="add"
aria-pressed="true"
>
200 + 10%
</button>
<button
type="button"
data-percent-operation="multiply"
aria-pressed="false"
>
200 × 10%
</button>
</div>
<div class="percent-display">
<span class="percent-expression" data-percent-expression
>200 +</span
>
<strong data-percent-display>20</strong>
</div>
<div class="percent-controls" hidden>
<button
type="button"
class="percent-key"
data-percent-key="percent"
>
%
</button>
<button
type="button"
class="percent-key"
data-percent-key="equals"
disabled
>
=
</button>
<button
type="button"
class="percent-reset"
data-percent-key="reset"
>
Reset
</button>
</div>
<p class="percent-status" data-percent-status role="status">
10% of 200 = 20. Then 200 + 20 = 220.
</p>
<figcaption>
Interactive illustration of the inspected percentage rule.
</figcaption>
</figure>
<div class="percent-explanation">
<div class="rea-finding">
<p class="finding-label">REA returned</p>
<p>
<strong
>The % handler’s original instructions and decompiled
code.</strong
>
The agent reads the two branches and explains which rule each
operator uses.
</p>
</div>
<p>
For this example, <code>previous = 200</code> and
<code>current = 10</code>.
</p>
<div class="agent-terminal">
<div class="terminal-header">
<span class="terminal-title"
><span class="terminal-dots" aria-hidden="true"
><i></i><i></i><i></i></span
>Example prompt · Calculator</span
>
<button
class="copy-button"
type="button"
data-copy="calculator-analysis-prompt"
aria-label="Copy Calculator analysis prompt"
>
Copy
</button>
</div>
<p class="terminal-prompt">
<span class="prompt-symbol" aria-hidden="true">›</span
><span id="calculator-analysis-prompt"
>Use REA to inspect Windows Calculator. Why does 200 + 10%
give 220? Show the code behind the % button.</span
><span class="terminal-cursor" aria-hidden="true"></span>
</p>
</div>
<div class="code-block">
<div class="code-header">
<span>Readable summary of the % handler</span>
</div>
<pre><code>if (operation == multiply || operation == divide) {
percent = current / 100;
} else {
<span class="code-key">percent = current * previous / 100;</span>
}</code></pre>
</div>
<dl class="percent-rules">
<div>
<dt>With +</dt>
<dd>
<strong>Take 10% of the first number.</strong
><code>10% of 200 = 20 → 200 + 20 = 220</code>
</dd>
</div>
<div>
<dt>With ×</dt>
<dd>
<strong>Turn 10% into 0.1.</strong
><code>200 × 0.1 = 20</code>
</dd>
</div>
</dl>
</div>
</div>
<figure class="workflow-figure calculator-trace">
<p class="figure-title">From the installed app to an explanation</p>
<ol class="flow-steps">
<li>
<span class="flow-label">01 · REA reads calc.exe</span
><span class="flow-node">It launches the Calculator app</span
><span class="flow-note"
>The code opens <code>ms-calculator:</code>. The agent then
selects the installed app’s library.</span
>
</li>
<li>
<span class="flow-label">02 · REA reads the library</span
><span class="flow-node">Return the % handler’s code</span
><span class="flow-note"
>The function checks the operator and uses the constant
<code>100</code>.</span
>
</li>
<li>
<span class="flow-label">03 · Your agent interprets it</span
><span class="flow-node">Explain and reproduce the rules</span
><span class="flow-note"
>Crosscheck the branch with Microsoft’s source, then try + and
× above.</span
>
</li>
</ol>
</figure>
<details class="home-evidence-details">
<summary>See the real code and how the answer was checked</summary>
<div class="code-comparison">
<div class="code-block">
<div class="code-header">
<span>REA · selected original instructions</span>
</div>
<pre><code>0x180124945: MOV EAX, dword ptr [R13 + 0x18]
0x180124949: <span class="code-key">CMP EAX, 0x5c</span>
0x18012494c: JZ 0x180124aba
0x180124952: <span class="code-key">CMP EAX, 0x5b</span>
0x180124955: JZ 0x180124aba
0x18012495b: <span class="code-key">MOV EDX, 0x64</span></code></pre>
</div>
<div class="code-block">
<div class="code-header">
<span>Operator IDs · Microsoft’s source</span>
</div>
<pre><code>#define IDC_MUL 92 // 0x5c
#define IDC_DIV 91 // 0x5b
#define IDC_PERCENT 118 // 0x76
0x64 = 100</code></pre>
</div>
</div>
<p class="caption">
Inspected with REA 4.1.0: Windows Calculator 11.2508.4.0, x64. The
readable summary uses names from Microsoft’s public source to
explain the recovered branch.
</p>
<p class="caption">
<a
href="https://github.com/microsoft/calculator/blob/d125246a4e19842ce1332e6c7839cf0e110027d8/src/CalcManager/CEngine/scifunc.cpp#L98-L111"
>Percentage implementation</a
>
·
<a
href="https://github.com/microsoft/calculator/blob/d125246a4e19842ce1332e6c7839cf0e110027d8/src/CalculatorUnitTests/CalculatorManagerTest.cpp#L350-L370"
>Microsoft’s test cases</a
>
· <a href="guides/native/">Native setup guide</a>
</p>
</details>
</div>
</section>
<section class="section" id="try-rea">
<div class="container start-row">
<div>
<p class="eyebrow">Your first investigation</p>
<h2>Try REA on a small app.</h2>
<p>
Download our Notes example, trace its CSV export, and check one
changed input.
</p>
</div>
<a class="button" href="first-investigation/"
>Try the guided example</a
>
</div>
</section>
@@ -139,34 +867,6 @@
</div>
</section>
<section class="section" aria-label="How an investigation works">
<div class="container">
<figure class="explanatory-figure">
<div
class="figure-viewport"
tabindex="0"
role="region"
aria-label="REA investigation flow; scroll horizontally on smaller screens"
>
<img
src="assets/figures/rea-investigation-flow.svg"
width="1774"
height="887"
alt="Ask a question about a local app, binary or browser. Your agent uses REA through CLI or MCP to inspect and trace with analysis tools. REA returns code, references and unknowns. Your agent uses the evidence to explain, implement and test, and can ask follow-up questions."
decoding="async"
/>
</div>
<figcaption>
REA connects your agent to analysis tools. The findings guide the
next question, explanation or implementation.
<a href="assets/figures/rea-investigation-flow.svg"
>Open figure</a
>
</figcaption>
</figure>
</div>
</section>
<section class="section">
<div class="container feature-case">
<div>
@@ -177,12 +877,6 @@
in C, using REA to inspect the executable and independent tests to
check the recovered behavior.
</p>
<p>
To recover a sound-pan calculation, the agent used REA to inspect
the instructions, follow a caller and read the constants. Those
findings led to a C function checked against the original behavior
and all 63 compiled bytes.
</p>
<p>
<a class="text-link" href="showcase/dx-ball/"
>Follow the investigation</a
+47 -10
View File
@@ -57,6 +57,40 @@ followed by several qualifications.
## Build a page around one question
### Introductions and first exercises
Explain reverse engineering with a familiar behavior. Pair a short, authentic
code excerpt with readable logic and a figure that explains the result without
requiring the reader to understand either language. Show a simple agent prompt
and the specific facts REA supplies to answer it.
Put compact setup at the beginning of the homepage: a copyable installation
prompt and the ordinary setup command. Then explain what reverse engineering
means and what it lets someone do, before the worked examples.
Begin each example with its goal and the reason to inspect that program.
Name the actual evidence REA returned and what the agent did with it.
Use short labels, selective bold text and the shared blue highlight to make
those facts visible when scanning. Keep source, interpretation and new code
attributed to their respective roles. On mobile, the demo can precede its
supporting code once its purpose is clear.
Show how the reader's task changes using the same question on both sides of a
manual/agent comparison. Let returned evidence make REA's contribution visible.
When showing manual analysis, use authentic instructions and specific analyst
questions: what a command ID means, which call performs arithmetic, or which
operand enters a calculation. Numbered selections can connect the code to
illustrative thought bubbles. Keep the agent side brief: one visible prompt,
a concrete answer, and the evidence used to reach it.
When a small reconstruction makes the finding tangible, let readers change an
input or setting and try the result. Connect inspection, recovered logic,
reconstruction and the new experiment. Keep the recovered rule distinct from
new teaching mechanics, and check it against the inspected program.
Offer a supplied target for the next step. A first exercise should take the reader through
setup, a question, an answer with source references, one prediction they can
check, and a follow-up. Introduce specialized prerequisites when the chosen
target requires them.
### Guides
1. Name the task and introduce a small example.
@@ -101,13 +135,14 @@ purposes, and immutable commit links for checkpoint-dependent facts.
Each figure should answer a question that a reader can name. Choose the visual
form that fits it:
| Relationship | Existing example | Useful form |
| ----------------------------------------- | ---------------------------------------- | -------------------------------------------------- |
| Analysis and verification steps | DX-Ball sound pan | Flow with separate verification branches |
| Code across process boundaries | Electron CSV export and Notion clipboard | HTML flow with APIs and channel names |
| A mathematical transformation | TH04's fixed and aimed rings | SVG drawn from the angle formula |
| Original instructions and readable source | DX-Ball and TH04 | Selectable HTML code with matching step highlights |
| A request caused by an action | Notes browser export | Flow, observed result table and script excerpt |
| Relationship | Existing example | Useful form |
| ----------------------------------------- | ---------------------------------------- | ------------------------------------------------------- |
| Analysis and verification steps | DX-Ball sound pan | Flow with separate verification branches |
| Code across process boundaries | Electron CSV export and Notion clipboard | HTML flow with APIs and channel names |
| A mathematical transformation | TH04's fixed and aimed rings | SVG drawn from the angle formula |
| Original instructions and readable source | DX-Ball and TH04 | Selectable HTML code with matching step highlights |
| A request caused by an action | Notes browser export | Flow, observed result table and script excerpt |
| Recovered behavior and a new experiment | Dinosaur speed reconstruction | Inspected code, playable demo and original-result check |
Use SVG or semantic HTML for diagrams with exact text, numbers and arrows.
Generated illustrations can help explore a layout, but the published labels,
@@ -198,6 +233,8 @@ New analysis or behavior claims need the real evidence that supports them; a moc
or a page-loading check cannot establish those claims.
Follow the PR review and CI process, then publish using the existing manual
`website-pages.yml` workflow on `main`. Ordinary commits should not publish the
site. After deployment, check the live page and confirm it matches the reviewed
version. The legacy VitePress build remains separate from the Pages publisher.
`website-pages.yml` workflow on `main`. It publishes the same verified artifact
to Cloudflare and GitHub Pages and checks both published commit markers.
Ordinary commits should not publish the site. After deployment, check both live
pages and confirm they match the reviewed version. The legacy VitePress build
remains separate from the Pages publisher.