Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"metadata": {
"description": "Content-readiness lint with evidence-bounded AI discovery experiments",
"version": "0.6.2"
"version": "0.7.0"
},
"plugins": [
{
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aeoptimize",
"description": "Content-readiness lint and evidence-bounded discovery experiments",
"version": "0.6.2",
"version": "0.7.0",
"author": {
"name": "Te-Shu Wang"
},
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
with:
path: .github/fixtures/action-low
min-score: '100'
package-spec: ./aeoptimize-0.6.2.tgz
package-spec: ./aeoptimize-0.7.0.tgz

- name: Validate Action outputs
env:
Expand All @@ -101,7 +101,7 @@ jobs:
uses: ./
with:
path: examples/github-action-sample/site
package-spec: ./aeoptimize-0.6.2.tgz
package-spec: ./aeoptimize-0.7.0.tgz

- name: Validate sample outputs
env:
Expand All @@ -120,7 +120,7 @@ jobs:
path: .github/fixtures/action-low
min-score: '0'
fail-on-low-score: 'true'
package-spec: ./aeoptimize-0.6.2.tgz
package-spec: ./aeoptimize-0.7.0.tgz

- name: Validate blocking outputs
env:
Expand All @@ -140,7 +140,7 @@ jobs:
path: .github/fixtures/action-low
min-score: '100'
fail-on-low-score: 'true'
package-spec: ./aeoptimize-0.6.2.tgz
package-spec: ./aeoptimize-0.7.0.tgz

- name: Invalid choice is rejected
id: invalid-choice
Expand All @@ -149,7 +149,7 @@ jobs:
with:
path: .github/fixtures/action-low
fail-on-low-score: sometimes
package-spec: ./aeoptimize-0.6.2.tgz
package-spec: ./aeoptimize-0.7.0.tgz

- name: Out-of-range threshold is rejected
id: invalid-threshold
Expand All @@ -158,7 +158,7 @@ jobs:
with:
path: .github/fixtures/action-low
min-score: '101'
package-spec: ./aeoptimize-0.6.2.tgz
package-spec: ./aeoptimize-0.7.0.tgz

- name: Assert expected failures
env:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable user-visible changes will be documented here. The project follows Semantic Versioning after the v0.6 evidence baseline is released.

## 0.7.0

### Added

- Added `audit-build` for local HTML directories with cross-page title/canonical review, syntax checks and optional `--expect-indexable --fail-on-error` CI gates.
- Added an evidence-backed `audit` command for one URL or HTML/Markdown file, with versioned `PASS`, `WARNING`, `FAIL`, and `N/A` checks.
- Added structured observations, remediation, validation guidance, and explicit limitations for HTTP, metadata, headings, canonical, robots directives, links, images, and JSON-LD.
- Added a bounded, same-origin `audit-site` command for robots-aware page discovery, sitemap comparison, HTTP failures, redirect chains, internal-link targets, canonical conflicts, orphan candidates, and duplicate titles.

### Compatibility

- Kept the v0.6 readiness score and existing `scan --json` contract unchanged.

## 0.6.2

### Fixed
Expand Down
79 changes: 75 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ npm install --save-dev aeoptimize
npx aeoptimize scan https://example.com
npx aeoptimize scan ./dist --dir
npx aeoptimize scan ./dist --dir --json
npx aeoptimize audit https://example.com --json
npx aeoptimize audit-site https://example.com --max-pages 20 --json
```

Example output:
Expand Down Expand Up @@ -58,6 +60,38 @@ Two often-promoted AEO signals are deliberately excluded from the score:

Every rule, its evidence class, and known false-positive boundary is documented in [docs/methodology.md](docs/methodology.md) and exercised by the [versioned public fixture corpus](fixtures/v0.6/rule-corpus.ts).

## Evidence-backed page audit

`audit` inspects one public URL or one local HTML/Markdown file. It is a separate, versioned contract and does not change the v0.6 readiness score or `scan --json` output.

```bash
npx aeoptimize audit https://example.com
npx aeoptimize audit ./dist/index.html --json
```

The first audit contract checks:

- HTTP status, final URL, and redirect evidence for URL targets;
- document title, meta description, headings, language, canonical, and page-level robots directives;
- discovered links, image alt attributes, and JSON-LD structural validity.

Each check returns `PASS`, `WARNING`, `FAIL`, or `N/A`, the observed evidence, an explanation, an optional remediation, and a validation step. `PASS` is bounded to the inspected evidence. It does not establish ranking, indexing, rich-result display, traffic, conversion, or AI citation.

The command intentionally reports unavailable site-wide and external measurements as limitations. It does not infer robots.txt policy, sitemap membership, hreflang reciprocity, broken-link status, Core Web Vitals, analytics, or actual search-engine index state from one page.

## Bounded site audit

`audit-site` follows same-origin links in deterministic order and stops at an explicit page limit. It reads robots.txt before subsequent page requests, discovers same-origin sitemap files, and uses response HTML without browser rendering.

```bash
npx aeoptimize audit-site https://example.com
npx aeoptimize audit-site https://example.com --max-pages 50 --json
```

The site contract reports bounded crawl coverage, robots policy, page status, redirect chains, internal link targets, canonical consistency, sitemap discrepancies, sitemap-only orphan candidates, and duplicate titles. Sitemap-only pages remain candidates until a sufficiently complete crawl or server-log evidence confirms their discovery state.

The default limit is 20 page requests and the accepted range is 1–200. Cross-origin page links are recorded only as counts, and subsequent redirects outside the audited origin are not followed. JavaScript-inserted links, actual search-engine crawl/index state, rankings, traffic, and conversions remain outside this contract.

## How it compares

| | aeoptimize | Lighthouse-style SEO audits | Hosted AEO/GEO platforms |
Expand All @@ -79,18 +113,18 @@ npx aeoptimize scan ./dist --dir --json > aeoptimize-report.json
node -e "const r=require('./aeoptimize-report.json'); process.exit(r.overall.total < 60 ? 1 : 0)"
```

The v0.6 GitHub Action is advisory by default. Consume it from the repository pin until it appears on GitHub Marketplace (Marketplace listing is a checkbox on a GitHub Release, not an extra package). It reports findings without blocking the workflow:
The GitHub Action is advisory by default. Consume it from the repository pin until it appears on GitHub Marketplace (Marketplace listing is a checkbox on a GitHub Release, not an extra package). It reports findings without blocking the workflow:

```yaml
- uses: cucuwang/aeoptimize@v0.6.2
- uses: cucuwang/aeoptimize@v0.7.0
with:
path: dist
```

Projects can explicitly choose blocking mode after accepting a baseline:

```yaml
- uses: cucuwang/aeoptimize@v0.6.2
- uses: cucuwang/aeoptimize@v0.7.0
with:
path: dist
fail-on-low-score: 'true'
Expand All @@ -101,6 +135,43 @@ The Action exposes `score` and `report` outputs in both modes. Its release is re

A copyable advisory workflow and controlled input are available in the [end-to-end Action sample](examples/github-action-sample/README.md).

## Audit built HTML before deployment

The `audit-build` command checks a local HTML file or build directory and reports evidence,
remediation and validation for each finding. It leaves the existing `scan` score and
JSON contract unchanged.

```bash
npx aeoptimize audit-build ./dist --json
npx aeoptimize audit-build ./dist --base-url https://example.com/ --expect-indexable --fail-on-error --json > audit.json
```

Malformed JSON-LD and invalid or multiple canonical declarations produce `FAIL`.
HTML `noindex` and `none` are warnings unless `--expect-indexable` is supplied.
Missing or repeated titles/descriptions and cross-page title/canonical reuse are
advisory. Shared canonicals can be intentional; they are never automatically rewritten.

`--fail-on-error` exits with code 1 when a `FAIL` is present, while still writing the
complete report. Input errors also exit 1. Without it, a completed audit is advisory.
Use `--expect-indexable` only for pages intended for standalone search indexing.

This command reads source HTML without fetching URLs or launching a browser.
HTTP headers, robots.txt and actual indexing are explicitly unassessed. JSON-LD
checks cover JSON syntax and root shape; schema semantics and visible-content
consistency require separate validation. Missing JSON-LD is `N/A`.

For a file, `--base-url` is its deployed page URL. For a directory, it is the
deployment root; relative file paths are appended without inferring hosting rewrites.
An HTML `base` element is respected. Relative canonicals without a resolvable base
are `N/A`. Hidden entries, `node_modules` and symlinks are excluded from traversal;
an explicit symlink input is rejected. Unreadable files and files over 5 MB stop
the audit instead of silently dropping pages.

Rules follow the [robots meta specification](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)
and [canonical URL guidance](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls).
A syntax pass does not establish eligibility under the
[structured-data policies](https://developers.google.com/search/docs/appearance/structured-data/sd-policies).

## Optional generators

```bash
Expand Down Expand Up @@ -175,7 +246,7 @@ npx skills add cucuwang/aeoptimize

## Project status

The v0.6 evidence baseline focuses on methodology, reproducible fixtures, CI compatibility, packaging, and external adoption—not more scoring rules. Release acceptance and rollback are documented in [docs/release-v0.6.md](docs/release-v0.6.md); longer-term adoption work remains in [ROADMAP.md](ROADMAP.md).
Version 0.7 adds page, build, and bounded site audits while retaining the v0.6 scoring contract. Release acceptance and rollback are documented in [docs/release-v0.7.md](docs/release-v0.7.md); longer-term adoption work remains in [ROADMAP.md](ROADMAP.md).

Contributions are welcome. Rule changes require an evidence note and positive/negative fixtures; see [CONTRIBUTING.md](CONTRIBUTING.md). Report vulnerabilities through the process in [SECURITY.md](SECURITY.md).

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inputs:
package-spec:
description: npm package spec to install; keep the default outside prerelease testing
required: false
default: 'aeoptimize@0.6.2'
default: 'aeoptimize@0.7.0'

outputs:
score:
Expand Down
2 changes: 1 addition & 1 deletion action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inputs:
package-spec:
description: npm package spec to install; keep the default outside prerelease testing
required: false
default: 'aeoptimize@0.6.2'
default: 'aeoptimize@0.7.0'

outputs:
score:
Expand Down
21 changes: 21 additions & 0 deletions docs/methodology.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ A scoring-rule change must include:

The v0.6 fixture corpus is published in [`fixtures/v0.6/rule-corpus.ts`](../fixtures/v0.6/rule-corpus.ts) and is enforced by the release-contract tests. Outcome research, if added later, will be reported separately from the readiness score.

## Evidence-backed audit contract

The `audit` command is separate from the v0.6 score contract. It reports one of four statuses for each bounded check:

| Status | Meaning |
| --- | --- |
| `PASS` | The inspected evidence satisfies the check's documented condition. This is not an external-outcome guarantee. |
| `WARNING` | A deterministic observation needs contextual review or may be intentional. |
| `FAIL` | The inspected evidence confirms a structural or retrieval failure within the check's scope. |
| `N/A` | The required evidence is unavailable or the check does not apply to this source type. |

Each check includes observed evidence, an explanation, optional remediation, and a validation step. The contract does not derive robots.txt policy, sitemap membership, hreflang reciprocity, site-wide duplication, orphan status, Core Web Vitals, analytics, or search-engine index state from a single document.

### Bounded site audit

The `audit-site` contract uses a same-origin, sequential queue with an explicit 1–200 page limit. It processes links in discovery order before sitemap-only seeds, reads applicable `aeoptimize` or wildcard robots rules, and does not follow subsequent redirects outside the audited origin.

The crawler uses response HTML without browser rendering. A Sitemap-only URL with no internal inlink is reported as an orphan candidate because JavaScript navigation, pages beyond the configured limit, and other discovery sources may still link to it. Broken-link findings require an observed failed response; queued but unfetched links remain warnings.

robots.txt matching covers applicable user-agent groups, `Allow`, `Disallow`, `*` wildcards, and `$` endings. Unusual policies need manual review. An unavailable robots.txt response that is not an ordinary 404 causes conservative skipping of subsequent matching URLs.

## Primary sources

- [Google Search: AI features and your website](https://developers.google.com/search/docs/appearance/ai-features)
Expand Down
42 changes: 42 additions & 0 deletions docs/release-v0.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# v0.7 release and rollback guide

Version 0.7.0 adds three evidence-backed audit workflows while retaining the v0.6.0 scoring methodology and existing `scan --json` contract.

- `audit` inspects one URL or a local HTML/Markdown file.
- `audit-build` checks built HTML with cross-page review and optional CI failure gates.
- `audit-site` performs a bounded, same-origin crawl and compares discovered links, canonical declarations and sitemap entries.

Audit statuses describe the evidence collected. Unavailable evidence remains unassessed. Actual search indexing, rankings, traffic and AI citation outcomes are outside these contracts.

## Release acceptance

1. Build from a clean release commit after `npm ci` and run `npm run release:check`.
2. Require passing Node.js 22 and 24 CI, package reproducibility, and Action contract checks on the exact merged `main` commit.
3. Preserve the candidate manifest and SHA-256. Confirm all three CLI aliases and audit commands work from that exact packed artifact in a clean consumer.
4. Verify the npm account immediately before publication, fetch `origin/main`, and require the publish source gate to confirm the exact commit.
5. Publish npm 0.7.0, then create the immutable `v0.7.0` tag and GitHub Release at that same commit. These external steps require maintainer authorization.

`prepublishOnly` runs the candidate and source gates. The source gate requires `HEAD` to equal the freshly fetched `origin/main` commit. Do not bypass it or publish a pre-merge feature commit.

## Publication readback

Verify npm metadata and the exact version, download its tarball, compare its SHA-256 with the candidate, and install all CLI aliases from those verified bytes. Confirm the immutable tag and published GitHub Release independently.

```bash
npm view aeoptimize version dist-tags --json
npm view aeoptimize@0.7.0 version gitHead dist --json
bash scripts/verify-release-v0.6.sh <verified-release-commit> <verified-package-sha256>
```

The public verifier keeps its historical filename and reads the expected version from package.json. When npm supplies `gitHead`, it must match the release commit. The tarball hash is required even when that optional metadata field is absent.

## Rollback

With explicit rollback authorization, restore `latest` to the last fully published release and deprecate the problematic version.

```bash
npm dist-tag add aeoptimize@0.6.2 latest
npm deprecate aeoptimize@0.7.0 "Use 0.6.2 while an audit regression is corrected."
```

Update the GitHub Release with the same warning. Preserve existing tags and exact-version artifacts, then fix forward with a new version and repeat the release gates.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cucuwang/aeoptimize@v0.6.2
- uses: cucuwang/aeoptimize@v0.7.0
with:
path: site
fail-on-low-score: 'false'
2 changes: 1 addition & 1 deletion examples/github-action-sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This directory is a copyable end-to-end sample for the v0.6 Action contract.
- `site/index.html` is a deterministic public input.
- The Action is advisory by default. The sample does not block a pull request on an unreviewed score threshold.

The workflow becomes reproducible only after both `aeoptimize@0.6.2` exists on npm and the immutable `v0.6.2` Git tag points to the matching release commit. Until both artifacts exist, use the local CLI or the release-candidate package during controlled verification.
The workflow becomes reproducible only after both `aeoptimize@0.7.0` exists on npm and the immutable `v0.7.0` Git tag points to the matching release commit. Until both artifacts exist, use the local CLI or the release-candidate package during controlled verification.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aeoptimize",
"version": "0.6.2",
"version": "0.7.0",
"description": "Deterministic content-readiness lint for static websites and documentation",
"type": "module",
"main": "./dist/core/index.js",
Expand All @@ -26,6 +26,7 @@
".claude-plugin/",
"docs/methodology.md",
"docs/release-v0.6.md",
"docs/release-v0.7.md",
"CHANGELOG.md",
"CONTRIBUTING.md",
"ROADMAP.md",
Expand Down
17 changes: 17 additions & 0 deletions scripts/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ PACKAGE_SHA256=$(node -e "const crypto=require('node:crypto');const fs=require('

jq -e '
(.[0].files | map(.path) | index("dist/cli/index.js")) != null and
(.[0].files | map(.path) | index("dist/core/audit.js")) != null and
(.[0].files | map(.path) | index("dist/core/static-audit.js")) != null and
(.[0].files | map(.path) | index("dist/core/site-audit.js")) != null and
(.[0].files | map(.path) | index("docs/release-v0.7.md")) != null and
(.[0].files | map(.path) | index("fixtures/v0.6/rule-corpus.ts")) != null and
(.[0].files | map(.path) | index("examples/github-action-sample/.github/workflows/aeoptimize.yml")) != null and
(.[0].files | map(.path) | index("scripts/verify-release-candidate.sh")) != null and
Expand All @@ -70,6 +74,19 @@ for binary in aeoptimize aeo aeo-cli; do
fi
done

for audit_command in audit audit-build audit-site; do
"$CONSUMER_ROOT/node_modules/.bin/aeoptimize" "$audit_command" --help >/dev/null
done

"$CONSUMER_ROOT/node_modules/.bin/aeoptimize" audit \
"$CONSUMER_ROOT/node_modules/aeoptimize/examples/github-action-sample/site/index.html" \
--json > "$VERIFY_ROOT/page-audit.json"
"$CONSUMER_ROOT/node_modules/.bin/aeoptimize" audit-build \
"$CONSUMER_ROOT/node_modules/aeoptimize/examples/github-action-sample/site" \
--json > "$VERIFY_ROOT/build-audit.json"
jq -e '.contractVersion == "1.0" and (.checks | length > 0)' "$VERIFY_ROOT/page-audit.json" >/dev/null
jq -e '.contractVersion == "1.0" and .source == "local-html" and (.pages | length == 1)' "$VERIFY_ROOT/build-audit.json" >/dev/null

MANIFEST=$(jq -n \
--arg version "$PACKAGE_VERSION" \
--arg filename "$PACKAGE_FILENAME" \
Expand Down
Loading
Loading