Skip to content

W4: Chapters + Patterns + Start + cutover from mkdocs#10

Merged
sunilp merged 21 commits into
masterfrom
astro-redesign-w4
May 13, 2026
Merged

W4: Chapters + Patterns + Start + cutover from mkdocs#10
sunilp merged 21 commits into
masterfrom
astro-redesign-w4

Conversation

@sunilp
Copy link
Copy Markdown
Owner

@sunilp sunilp commented May 13, 2026

⚠ THIS PR PERFORMS THE LIVE CUTOVER FROM MKDOCS TO ASTRO

Two manual user actions are required before/during the merge:

🔴 ACTION 1 — Before merging this PR:

  1. Open https://github.com/sunilp/agentic-ai/settings/pages
  2. Under "Build and deployment" → "Source", change from "Deploy from a branch" (currently gh-pages) to "GitHub Actions"
  3. Save

This switches GitHub Pages to consume the artifact produced by .github/workflows/astro-deploy.yml (via actions/deploy-pages) instead of the gh-pages branch that mkdocs has been writing to.

If this is NOT done before merge, the new workflow will run successfully but GitHub Pages will continue serving the old gh-pages branch content. The site will not actually flip.

🟡 ACTION 2 — After merge + successful deploy:

Submit the new sitemap to Google Search Console:

  1. Open https://search.google.com/search-console
  2. Select the sunilprakash.com property
  3. Sitemaps → Add new sitemap → enter: https://sunilprakash.com/agentic-ai/sitemap-index.xml

Rollback plan

If the cutover breaks the live site, revert in two steps:

  1. In GitHub Settings → Pages, switch Source back to "Deploy from a branch" → gh-pages. mkdocs gh-pages branch is unchanged from before this PR.
  2. Force-reset master to the tagged commit:
    git push origin legacy-mkdocs-final:master --force-with-lease

The site will then serve the old mkdocs build from gh-pages again. The W4 work stays preserved on the astro-redesign-w4 branch for re-attempt.

Summary

Week 4 of the 4-week mkdocs → Astro 5 migration. Builds on W1 (#7), W2 (#8), W3 (#9). This PR:

  • Ports 5 Foundations chapters (00a-00e) from docs/book/ to MDX with proper frontmatter, Callouts, and image path updates. 1700+ lines of substantive content.
  • Ports Chapter 1 "What 'Agentic' Actually Means" (239 lines, the Part I opener) with patterns + references.
  • Ports 12 chapter stubs (02-13) preserving URL stability. Source files are already stubs (13-35 lines each); the redesign preserves them as drafts until full content is authored. Status set to draft in frontmatter.
  • Authors 12 cross-cutting patterns from scratch: workflow-first, hub-and-spoke, verifier-loop, eval-loop, tool-registry, approval-gate, escalation-path, trace-the-truth, failure-buckets, earn-the-complexity, cold-start-mitigation, agent-loop. Each with whenToUse, whenNotToUse, optional antiPattern callout.
  • Builds 3 new layouts: ChapterLayout (Reader + sticky ChapterMap sidebar + NextPrev + ProgressReader + cross-links), PatternLayout (whenToUse + whenNotToUse + antiPattern + used-in cross-links).
  • Adds 3 new universal components: ChapterMap (18-chip visual sitemap with current highlight), ProgressReader (CSS scroll-driven progress bar), NextPrev (chapter pagination).
  • Ships /start/ audience routing page with 3 tracks: New to agentic AI / Building / Running in production.
  • Updates /book/ index to show 18 chapters organized by 5 Parts with anchor IDs (#foundations, #part-1, #part-2, #part-3, #part-4) that match homepage BJO links.
  • Integrates @astrojs/sitemap — generates sitemap-index.xml + sitemap-0.xml at build, indexing all 55 published pages.
  • CI workflow switch: .github/workflows/astro-deploy.yml trigger changed from workflow_dispatch (manual) to push: master. .github/workflows/deploy.yml (mkdocs gh-deploy) DELETED.
  • Tag legacy-mkdocs-final placed on the last mkdocs master commit for rollback.

Final build state

  • 60 pages total in dist/ (55 indexed by Pagefind, 5 redirect stubs)
  • 18 chapters all building (5 Foundations + 13 chapters)
  • 12 patterns built
  • 11/11 tests passing
  • 0 type errors, 0 warnings (clean astro check across 78 files)
  • Sitemap in dist/sitemap-index.xml
  • mkdocs files (docs/, mkdocs.yml) left in repo as legacy — not part of the deploy

Test Plan

  • pnpm install && pnpm test — expect 11/11 passing
  • pnpm astro check — expect 0 errors
  • pnpm build — expect ~60 pages built including Pagefind index + sitemap
  • pnpm dev and spot-check at least one page from each content type:
    • /agentic-ai/ (homepage)
    • /agentic-ai/start/ (audience routing — NEW)
    • /agentic-ai/book/ (full TOC with 18 chapters by Part — NEW)
    • /agentic-ai/book/00a-how-llms-work/ (Foundations — NEW substantive port)
    • /agentic-ai/book/01-what-agentic-means/ (Part I opener — NEW)
    • /agentic-ai/book/04-multi-agent-without-theater/ (a stub chapter — NEW)
    • /agentic-ai/patterns/ (pattern index — NEW)
    • /agentic-ai/patterns/workflow-first/ (one pattern hub — NEW)
  • Click between chapters via NextPrev — confirm navigation works
  • Resize window to mobile width — confirm ChapterMap sidebar hides
  • Test ProgressReader: scroll a long chapter; brick-red bar at top should fill 0% → 100%
  • Cmd+K search: type "agent" → results return from chapters, patterns, FNs, etc.

What's deferred / not in this PR

  • Content audit of baseline-eval-report.mdx 19-vs-18 discrepancy (inherited from W3) — flagged as content-author follow-up
  • Codex banner generation for proper og-default.png — still using fn-001 placeholder from W2
  • Substantive content for chapter stubs 02-13 — frontmatter status: draft, URLs preserved for SEO stability

Inherited known issues from W3

  • evaluating-and-hardening, failure-cases reconciliation tied to baseline 19-vs-18 inconsistency in source markdown

Summary by CodeRabbit

  • New Features

    • Sitemap generation enabled.
    • Chapter navigation UI, pagination controls, and top reading progress bar added.
    • Book and Patterns sections with dynamic routing, indexes, and pattern pages.
    • Auto-deploy on pushes to master/main enabled.
  • Documentation

    • Added 13 new book chapters on agents, tools, evaluation, deployment, and more.
    • Added 11+ pattern documentation entries.
    • README updated with local development and tooling instructions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

📝 Walkthrough

Walkthrough

Adds a complete Astro-based book site: 14 new MDX chapter pages, pattern pages, layouts, navigation components, dynamic routes and index pages; integrates sitemap support; and changes CI workflows to enable auto-deploy on pushes to master/main while removing the older deploy workflow.

Changes

Site content, layouts, routing, and components

Layer / File(s) Summary
Chapter & pattern content
src/content/chapters/*, src/content/patterns/*
Adds 14 chapter MDX files (00a→13) and ~13 pattern MDX pages with frontmatter, body content, examples, and references.
Layouts and page rendering
src/layouts/ChapterLayout.astro, src/layouts/PatternLayout.astro
New layouts that load collections, build reverse-link indices, compute prev/next navigation, and render main/sidebar views (includes scoped CSS and typed props).
Dynamic routes & indexes
src/pages/book/[...slug].astro, src/pages/book/index.astro, src/pages/patterns/[...slug].astro, src/pages/patterns/index.astro, src/pages/start/index.astro
Adds static-path generation for chapters/patterns, book and patterns index pages, and a /start learning-tracks page with curated chapter lists.
Navigation components
src/components/universal/ChapterMap.astro, src/components/universal/NextPrev.astro, src/components/universal/ProgressReader.astro
New reusable UI: chapter visual sitemap, previous/next pagination with placeholders, and a scroll-progress bar using scroll-timeline (with reduced-motion and graceful degradation).
README updates & developer docs
README.md
Replaces Make-based Getting Started with Node 22+/pnpm local dev instructions, adds stack and content-type documentation, and documents Python example entry points.

Build, integrations, and CI

Layer / File(s) Summary
GitHub Actions deploy workflow
.github/workflows/astro-deploy.yml, .github/workflows/deploy.yml
Updated astro-deploy.yml to also trigger on push to master/main (retains workflow_dispatch); removed the older .github/workflows/deploy.yml file (which contained test + mkdocs deploy jobs).
Sitemap integration & deps
astro.config.mjs, package.json
Enabled @astrojs/sitemap integration in astro.config.mjs and added @astrojs/sitemap to package.json dependencies.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • sunilp/agentic-ai#7: Related changes touching the GitHub Pages deployment workflow and sitemap integration.

Poem

🐰
I stitched a map of chapters, bright and true,
Pages and patterns hopping into view.
A progress bar blushes at the top so red,
Deploys wake on push — the trail ahead.
Hop on, read, iterate — nibble knowledge like bread.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: a major cutover from MkDocs to Astro, adding chapters, patterns, and a new start page. While abbreviated, it accurately summarizes the key scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astro-redesign-w4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/astro-deploy.yml (2)

13-15: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Set cancel-in-progress: true to prevent deployment race conditions.

With cancel-in-progress: false, rapid successive pushes to master or main will trigger concurrent deployments, potentially causing nondeterministic final state or resource conflicts. For deployment workflows, it's safer to cancel in-progress runs so the latest commit always wins.

🔄 Proposed fix
 concurrency:
   group: "pages"
-  cancel-in-progress: false
+  cancel-in-progress: true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/astro-deploy.yml around lines 13 - 15, Change the
concurrency setting so in-progress deployments are cancelled: update the
concurrency block's cancel-in-progress value from false to true (the concurrency
config and the cancel-in-progress property in the workflow) so only the latest
run for the "pages" group proceeds and previous runs are aborted.

32-34: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add lint, typecheck, and test steps before build.

The workflow deploys directly after pnpm build without running validation steps. The PR description mentions "11/11 tests passing; 0 type errors, 0 warnings," and the AI summary notes that the deleted deploy.yml previously included lint/typecheck/test jobs. Omitting these checks risks deploying broken code to production.

🧪 Proposed fix to add validation steps
       - run: pnpm install --frozen-lockfile

+      - run: pnpm lint
+
+      - run: pnpm typecheck
+
+      - run: pnpm test
+
       - run: pnpm build
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/astro-deploy.yml around lines 32 - 34, The workflow
currently runs install and pnpm build only; add explicit validation steps before
the build by inserting run steps for lint, typecheck, and tests (e.g., run: pnpm
lint, run: pnpm typecheck, run: pnpm test) prior to the existing pnpm build step
so the job fails fast on lint/type/test regressions; ensure these steps use the
same node version/setup as the install step and reference the same workspace if
using pnpm workspaces.
🧹 Nitpick comments (2)
src/components/universal/ChapterMap.astro (1)

12-33: 🏗️ Heavy lift

Consider deriving the chapter structure from collection metadata.

The hardcoded parts array creates a maintenance burden—if chapters are added, removed, or reorganized in the chapters collection, this navigation must be manually kept in sync. Consider deriving this structure from chapter frontmatter (e.g., a part field) to maintain a single source of truth.

Potential approach

Instead of hardcoding, you could:

  1. Add a partOrder or similar field to chapter frontmatter
  2. Query all chapters via getCollection('chapters') in the parent layout
  3. Pass the grouped structure as a prop to ChapterMap

This would eliminate drift between content and navigation structure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/universal/ChapterMap.astro` around lines 12 - 33, The
hardcoded parts array in ChapterMap should be replaced by deriving the structure
from chapter collection metadata: add a frontmatter field like part and optional
partOrder/chapOrder to each chapter, call getCollection('chapters') in the
parent layout (or a loader) to fetch all chapters, group them by the frontmatter
part value and sort groups by partOrder and items by chapOrder/title, then pass
the resulting grouped structure as a prop (e.g., parts or chapterMap) into the
ChapterMap component instead of the static parts constant so navigation reflects
the single source of truth.
src/pages/patterns/index.astro (1)

30-33: ⚡ Quick win

Consider improving semantic structure for pattern cards.

While the current link structure is functional and accessible, wrapping each card in an <article> element or using a heading tag for the pattern name would improve the semantic structure and document outline.

🎯 Proposed semantic markup improvement
-          <a class="pat-card" href={`/agentic-ai/patterns/${e.data.slug}/`}>
-            <div class="pat-card__name">{e.data.name}</div>
-            <p class="pat-card__one-line">{e.data.oneLine}</p>
-          </a>
+          <article>
+            <a class="pat-card" href={`/agentic-ai/patterns/${e.data.slug}/`}>
+              <h3 class="pat-card__name">{e.data.name}</h3>
+              <p class="pat-card__one-line">{e.data.oneLine}</p>
+            </a>
+          </article>

Then adjust the CSS to reset the heading margin:

   .pat-card__name {
     font-family: var(--font-display);
     font-size: var(--display-3);
     font-weight: 500;
     line-height: var(--lh-snug);
+    margin: 0;
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/patterns/index.astro` around lines 30 - 33, Wrap each pattern card
in an <article> to improve semantics and change the pattern title element inside
the card from the div with class "pat-card__name" to a heading (e.g., h3) so the
document outline is preserved; update the anchor structure inside the new
<article> so the <a class="pat-card"> remains the interactive element linking to
`/agentic-ai/patterns/${e.data.slug}/`. Also adjust the stylesheet to reset
default heading margins for the pattern card title (target the "pat-card__name"
class or the new heading selector) so layout doesn't shift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/content/chapters/01-what-agentic-means.mdx`:
- Line 158: Update the roadmap paragraph (the sentence starting "In Chapter 2,
we build the components...") so chapter references match the book structure:
keep Chapter 2 as building components, Chapter 3 as deterministic workflow vs
bounded agent, Chapter 4 as evaluation plus tracing/reliability/security
hardening, and Chapter 5 as stepping back to ask whether the task needed an
agent; adjust the chapter numbers in that single sentence accordingly.

In `@src/content/chapters/03-workflow-first-agent-second.mdx`:
- Line 15: Update the user-facing bullet text to hyphenate the compound
adjective: change the phrase "LLM-driven decision making" in the bullet that
starts with "The bounded agent" to "LLM-driven decision-making" so the compound
modifier is consistent and readable.

In `@src/content/chapters/07-when-not-to-use-agents.mdx`:
- Line 36: The Amazon link "[Get the book on
Amazon](https://www.amazon.com/dp/B0GVG6848F)" in the chapter currently returns
HTTP 503; verify the URL responds successfully and replace it if it's
dead—either update the href to a working Amazon product URL or remove/replace
the link with an alternate retailer or a non-link reference; ensure the markdown
anchor text "[Get the book on Amazon]" is preserved or updated to match the new
URL or vendor.

In `@src/content/chapters/12-memory-management.mdx`:
- Line 23: Update the broken companion-link text "src/ch12/" in the line that
reads "The working code for this chapter is in [`src/ch12/`](...)" to point to
the correct directory name "src/ch12_memory/"; replace the displayed path and
the URL fragment so the markdown reads "The working code for this chapter is in
[`src/ch12_memory/`](...)" ensuring the link target matches the actual repo
folder used elsewhere (e.g., memory-agent.mdx).

In `@src/layouts/ChapterLayout.astro`:
- Line 35: The call uses an unsafe assertion "as any" on allEntries when calling
entriesToContentEntries; update entriesToContentEntries (in
~/lib/content-helpers, the entriesToContentEntries function) to accept the
proper union type of your collection entries (or add a type guard/helper that
narrows allEntries to the correct union) so you can call
buildReverseIndex(entriesToContentEntries(allEntries)) without casting; adjust
the function signature and exports accordingly and remove the "as any" at the
call site.

In `@src/layouts/PatternLayout.astro`:
- Around line 31-33: The reverse-link lookup is using d.slug, which can miss
backlinks; change the getReverseLinks call to use the bare entry id instead
(e.g., replace getReverseLinks(reverseIndex, d.slug) with
getReverseLinks(reverseIndex, d.id)), and if your content shape stores the id
elsewhere extract the canonical entry id (from the object used by
buildReverseIndex/entriesToContentEntries) before calling getReverseLinks so the
lookup keys match the reverseIndex.

---

Outside diff comments:
In @.github/workflows/astro-deploy.yml:
- Around line 13-15: Change the concurrency setting so in-progress deployments
are cancelled: update the concurrency block's cancel-in-progress value from
false to true (the concurrency config and the cancel-in-progress property in the
workflow) so only the latest run for the "pages" group proceeds and previous
runs are aborted.
- Around line 32-34: The workflow currently runs install and pnpm build only;
add explicit validation steps before the build by inserting run steps for lint,
typecheck, and tests (e.g., run: pnpm lint, run: pnpm typecheck, run: pnpm test)
prior to the existing pnpm build step so the job fails fast on lint/type/test
regressions; ensure these steps use the same node version/setup as the install
step and reference the same workspace if using pnpm workspaces.

---

Nitpick comments:
In `@src/components/universal/ChapterMap.astro`:
- Around line 12-33: The hardcoded parts array in ChapterMap should be replaced
by deriving the structure from chapter collection metadata: add a frontmatter
field like part and optional partOrder/chapOrder to each chapter, call
getCollection('chapters') in the parent layout (or a loader) to fetch all
chapters, group them by the frontmatter part value and sort groups by partOrder
and items by chapOrder/title, then pass the resulting grouped structure as a
prop (e.g., parts or chapterMap) into the ChapterMap component instead of the
static parts constant so navigation reflects the single source of truth.

In `@src/pages/patterns/index.astro`:
- Around line 30-33: Wrap each pattern card in an <article> to improve semantics
and change the pattern title element inside the card from the div with class
"pat-card__name" to a heading (e.g., h3) so the document outline is preserved;
update the anchor structure inside the new <article> so the <a class="pat-card">
remains the interactive element linking to
`/agentic-ai/patterns/${e.data.slug}/`. Also adjust the stylesheet to reset
default heading margins for the pattern card title (target the "pat-card__name"
class or the new heading selector) so layout doesn't shift.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97ca9156-559e-4dff-a37d-973a658de05f

📥 Commits

Reviewing files that changed from the base of the PR and between 10fbd0b and 451704e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (45)
  • .github/workflows/astro-deploy.yml
  • .github/workflows/deploy.yml
  • README.md
  • astro.config.mjs
  • package.json
  • src/components/universal/ChapterMap.astro
  • src/components/universal/NextPrev.astro
  • src/components/universal/ProgressReader.astro
  • src/content/chapters/00a-how-llms-work.mdx
  • src/content/chapters/00b-api-to-tools.mdx
  • src/content/chapters/00c-first-agent.mdx
  • src/content/chapters/00d-frameworks.mdx
  • src/content/chapters/00e-connecting-to-mcp.mdx
  • src/content/chapters/01-what-agentic-means.mdx
  • src/content/chapters/02-tools-context-agent-loop.mdx
  • src/content/chapters/03-workflow-first-agent-second.mdx
  • src/content/chapters/04-multi-agent-without-theater.mdx
  • src/content/chapters/05-human-in-the-loop.mdx
  • src/content/chapters/06-evaluating-and-hardening.mdx
  • src/content/chapters/07-when-not-to-use-agents.mdx
  • src/content/chapters/08-metacognition.mdx
  • src/content/chapters/09-deployment.mdx
  • src/content/chapters/10-governance.mdx
  • src/content/chapters/11-security.mdx
  • src/content/chapters/12-memory-management.mdx
  • src/content/chapters/13-agent-protocols-in-production.mdx
  • src/content/patterns/agent-loop.mdx
  • src/content/patterns/approval-gate.mdx
  • src/content/patterns/cold-start-mitigation.mdx
  • src/content/patterns/earn-the-complexity.mdx
  • src/content/patterns/escalation-path.mdx
  • src/content/patterns/eval-loop.mdx
  • src/content/patterns/failure-buckets.mdx
  • src/content/patterns/hub-and-spoke.mdx
  • src/content/patterns/tool-registry.mdx
  • src/content/patterns/trace-the-truth.mdx
  • src/content/patterns/verifier-loop.mdx
  • src/content/patterns/workflow-first.mdx
  • src/layouts/ChapterLayout.astro
  • src/layouts/PatternLayout.astro
  • src/pages/book/[...slug].astro
  • src/pages/book/index.astro
  • src/pages/patterns/[...slug].astro
  • src/pages/patterns/index.astro
  • src/pages/start/index.astro
💤 Files with no reviewable changes (1)
  • .github/workflows/deploy.yml

Comment thread src/content/chapters/01-what-agentic-means.mdx Outdated
Comment thread src/content/chapters/03-workflow-first-agent-second.mdx Outdated

The complete chapter text is available in the book.

[Get the book on Amazon](https://www.amazon.com/dp/B0GVG6848F)
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify Amazon book link is accessible

curl -I -L -s -o /dev/null -w "%{http_code}" "https://www.amazon.com/dp/B0GVG6848F"

Repository: sunilp/agentic-ai

Length of output: 64


The Amazon book link currently returns HTTP 503 (Service Unavailable).

The URL https://www.amazon.com/dp/B0GVG6848F is not currently accessible. Confirm the link is working and returns a successful response before deployment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/content/chapters/07-when-not-to-use-agents.mdx` at line 36, The Amazon
link "[Get the book on Amazon](https://www.amazon.com/dp/B0GVG6848F)" in the
chapter currently returns HTTP 503; verify the URL responds successfully and
replace it if it's dead—either update the href to a working Amazon product URL
or remove/replace the link with an alternate retailer or a non-link reference;
ensure the markdown anchor text "[Get the book on Amazon]" is preserved or
updated to match the new URL or vendor.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushing back. The Amazon URL https://www.amazon.com/dp/B0GVG6848F is the canonical book product link, used in homepage CTA, SiteFooter, manifesto, R-001, and every chapter since W1. It returns 503 to non-browser User-Agents like curl's default — that's an Amazon anti-bot behavior, not a dead link. Manual browser visit returns 200. The link is correct; updating it across 18+ pages over a non-issue would be churn. Not applying.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunilp, you're absolutely right — Amazon's CDN/bot-protection layer is well-known for returning 503 to automated clients like curl with a default User-Agent, while serving 200 to real browsers. My check produced a false positive. The link is valid and no change is needed. Apologies for the noise.


✏️ Learnings added
Learnt from: sunilp
Repo: sunilp/agentic-ai PR: 10
File: src/content/chapters/07-when-not-to-use-agents.mdx:36-36
Timestamp: 2026-05-13T17:13:31.117Z
Learning: Amazon product URLs (e.g. `https://www.amazon.com/dp/...`) return HTTP 503 to non-browser User-Agents such as `curl` due to Amazon's anti-bot protection. This is NOT indicative of a dead link — a manual browser visit returns 200. Do not flag Amazon links as broken based on curl/automated HTTP checks returning 503 in the sunilp/agentic-ai repository (or in general). Always note this caveat instead of raising a "link broken" review comment for Amazon URLs.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: sunilp
Repo: sunilp/agentic-ai PR: 9
File: src/layouts/EvidenceLayout.astro:32-33
Timestamp: 2026-05-13T14:36:57.364Z
Learning: In this Astro MDX content-collection setup, cross-reference IDs used in `references` arrays and in `getReverseLinks` lookups must be **bare entry ids** (e.g., `workflow-vs-agent-comparison`), not prefixed with the collection name (e.g., do **not** use `evidence-workflow-vs-agent-comparison`). Frontmatter `id` fields for evidence/lab/project content must stay in sync with the Astro `entry.id` (filename/entry-based). Therefore, layout code should intentionally use `getReverseLinks(reverseIndex, d.id)` (where `d.id` is the bare id) rather than constructing any collection-prefixed id.

Comment thread src/content/chapters/12-memory-management.mdx Outdated
getCollection('patterns'),
]);
const allEntries = [...chapters, ...fieldNotes, ...recipes, ...labs, ...evidence, ...projects, ...patterns];
const reverseIndex = buildReverseIndex(entriesToContentEntries(allEntries as any));
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Avoid as any type assertion.

The type assertion as any when passing allEntries to entriesToContentEntries bypasses TypeScript's type safety. Consider updating the function signature to accept the union type of all collection entries, or create a proper type guard.

Suggested fix

Update entriesToContentEntries in ~/lib/content-helpers to accept the union of all collection entry types, or create a type-safe helper:

-const reverseIndex = buildReverseIndex(entriesToContentEntries(allEntries as any));
+const reverseIndex = buildReverseIndex(entriesToContentEntries(allEntries));

Then update the function signature in content-helpers.ts to handle the union type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/layouts/ChapterLayout.astro` at line 35, The call uses an unsafe
assertion "as any" on allEntries when calling entriesToContentEntries; update
entriesToContentEntries (in ~/lib/content-helpers, the entriesToContentEntries
function) to accept the proper union type of your collection entries (or add a
type guard/helper that narrows allEntries to the correct union) so you can call
buildReverseIndex(entriesToContentEntries(allEntries)) without casting; adjust
the function signature and exports accordingly and remove the "as any" at the
call site.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushing back. The as any cast is consistent across all 6 layouts (FieldNoteLayout, ProjectLayout, EvidenceLayout, LabReportLayout, ChapterLayout, PatternLayout). The proper fix is to widen the entriesToContentEntries parameter type to accept the Astro union of CollectionEntry types — which means refactoring src/lib/content-helpers.ts and removing 6 cast sites. Worth doing in a focused refactor PR; not worth doing during cutover. YAGNI for now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunilp, that's a fair call — a cutover PR is not the right place for a cross-cutting type refactor. Noted.

Would you like me to open a follow-up GitHub issue to track the entriesToContentEntries type widening so it doesn't get lost?


✏️ Learnings added
Learnt from: sunilp
Repo: sunilp/agentic-ai PR: 10
File: src/layouts/ChapterLayout.astro:35-35
Timestamp: 2026-05-13T17:13:39.716Z
Learning: In `sunilp/agentic-ai`, the `as any` cast on `allEntries` when calling `entriesToContentEntries(allEntries as any)` in layout files (ChapterLayout.astro, PatternLayout.astro, FieldNoteLayout.astro, ProjectLayout.astro, EvidenceLayout.astro, LabReportLayout.astro) is intentional and consistent across all 6 layouts. The proper fix — widening the `entriesToContentEntries` parameter in `src/lib/content-helpers.ts` to accept the full union of Astro `CollectionEntry` types and removing all 6 cast sites — is deferred to a dedicated refactor PR. Do not flag this `as any` cast in these layout files during reviews until that refactor is done.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: sunilp
Repo: sunilp/agentic-ai PR: 9
File: src/layouts/EvidenceLayout.astro:32-33
Timestamp: 2026-05-13T14:36:57.364Z
Learning: In this Astro MDX content-collection setup, cross-reference IDs used in `references` arrays and in `getReverseLinks` lookups must be **bare entry ids** (e.g., `workflow-vs-agent-comparison`), not prefixed with the collection name (e.g., do **not** use `evidence-workflow-vs-agent-comparison`). Frontmatter `id` fields for evidence/lab/project content must stay in sync with the Astro `entry.id` (filename/entry-based). Therefore, layout code should intentionally use `getReverseLinks(reverseIndex, d.id)` (where `d.id` is the bare id) rather than constructing any collection-prefixed id.

Learnt from: sunilp
Repo: sunilp/agentic-ai PR: 9
File: src/pages/projects/index.astro:30-30
Timestamp: 2026-05-13T14:37:11.515Z
Learning: In this repository’s Astro site deployed to GitHub Pages, treat hardcoded internal href prefixes that begin with `/agentic-ai/` as intentional (they should match the configured Astro `base`/deployment path). Do not flag these links as an issue during reviews. The team prefers a single repo-wide update if the base path ever changes, rather than replacing link bases with `import.meta.env.BASE_URL` at every link site. Only reconsider if additional deploy targets/base paths are introduced.

Comment thread src/layouts/PatternLayout.astro
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/content/chapters/01-what-agentic-means.mdx`:
- Around line 7-14: Remove the invalid cross-reference entry "fn-001" from the
frontmatter references array in the MDX file; locate the YAML frontmatter block
containing the "references:" list (which currently includes 00c-first-agent,
03-workflow-first-agent-second, 04-multi-agent-without-theater, fn-001) and
delete the "fn-001" item (or replace it with a valid reference ID if you have
one) so the references array only contains existing reference IDs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75adf2f0-491d-4bb7-aa42-b2d165d63018

📥 Commits

Reviewing files that changed from the base of the PR and between 451704e and 6cfc453.

📒 Files selected for processing (4)
  • src/content/chapters/01-what-agentic-means.mdx
  • src/content/chapters/03-workflow-first-agent-second.mdx
  • src/content/chapters/12-memory-management.mdx
  • src/layouts/PatternLayout.astro
✅ Files skipped from review due to trivial changes (1)
  • src/content/chapters/12-memory-management.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/content/chapters/03-workflow-first-agent-second.mdx
  • src/layouts/PatternLayout.astro

Comment on lines +7 to +14
references:
- 00c-first-agent
- 03-workflow-first-agent-second
- 04-multi-agent-without-theater
- fn-001
patterns:
- workflow-first
- agent-loop
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify cross-references in frontmatter exist in their collections

echo "=== Checking references array ==="
for id in "00c-first-agent" "03-workflow-first-agent-second" "04-multi-agent-without-theater" "fn-001"; do
  echo "Checking: $id"
  fd -e mdx -e md "^${id}\\.mdx?\$" src/content/ | head -1
done

echo ""
echo "=== Checking patterns array ==="
for id in "workflow-first" "agent-loop"; do
  echo "Checking: $id"
  fd -e mdx -e md "^${id}\\.mdx?\$" src/content/ | head -1
done

echo ""
echo "=== Summary ==="
echo "Expected: Each ID should have found a matching file path."
echo "If any ID printed with no file path below it, that cross-reference is broken."

Repository: sunilp/agentic-ai

Length of output: 681


Remove the broken cross-reference fn-001 from the references array.

The reference fn-001 on line 9 does not match any entry in the codebase. Remove it or replace it with a valid reference ID.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/content/chapters/01-what-agentic-means.mdx` around lines 7 - 14, Remove
the invalid cross-reference entry "fn-001" from the frontmatter references array
in the MDX file; locate the YAML frontmatter block containing the "references:"
list (which currently includes 00c-first-agent, 03-workflow-first-agent-second,
04-multi-agent-without-theater, fn-001) and delete the "fn-001" item (or replace
it with a valid reference ID if you have one) so the references array only
contains existing reference IDs.

@sunilp sunilp merged commit e46614a into master May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant