| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(site): add <agent-trajectory> Web Component prototype A framework-free custom element that replays an Agent's ReAct loop step by step, intended for embedding directly in chapter prose so readers can watch a real Agent think — not just read about it. <agent-trajectory src="/extras/agent-lab/data/ch1-asean-capitals-gpt5.json" /> Components: - extras/agent-lab/agent-trajectory.js — the Web Component (vanilla, Shadow DOM, ~14 KB). Supports ▶ play / ⏭ step / reset, per-step thought/action/observation/answer colour coding, collapsible long observations, follows Material's light/dark palette - extras/agent-lab/SCHEMA.md — the trajectory JSON contract. Mirrors the _emit(...) calls in chapter1/web-search-agent/agent.py so a real run can be exported into this format with minimal transformation - extras/agent-lab/data/ch1-asean-capitals-gpt5.json — worked example based on the chapter 1 "东盟 10 国首都最近距离" task - extras/agent-lab/data/ch1-currency-ablation-no-tool-results.json — failure case showing the context-ablation loop from experiment 1-1 The component is not yet wired into chapter1.md — that lands in a follow-up once the trajectory JSON is regnerated from a live run. | 1 个月前 | |
fix(site): report machine-translation progress instead of crying wolf (#886) The MT notice decided whether the service was alive by checking, once and 12s in, whether translate.js had rewritten the notice's own text. The free giteeAI channel retries against two backup hosts, so a pass routinely lands after that deadline — and nothing ever looked again. Readers ended up on a fully translated page still being told "Machine translation is unavailable". Drive the notice off translate.js' lifecycle hooks instead: execute.start means a pass began, translateNetworkAfter reports each source-language batch (result 1/0), renderFinish means the pass rendered. That gives three honest states — translating (with a spinner), translated, unavailable — and a pass that lands late now clears the warning rather than being ignored. All three wordings sit in the DOM at once so a single pass translates them, leaving the state switch a class change rather than fresh untranslated English. Two related fixes fall out of it: * failureTimeoutMs becomes a stall window, restarted by every batch that comes back, rather than a deadline for the whole pass. * <html lang>/dir is only switched once the page really is translated. It used to flip to the target locale (and to RTL) over English prose. Also ignore #lang-menu / #lang-selector. translate.js batches per detected source language, and the switcher lists every edition under its own endonym (中文, 日本語, العربية, עברית …), so those labels alone cost one API request per script — ten in a burst on a live page, which the channel rejects with "您当前2秒内的请求次数已超过2次" and which took the page's own batch down with it. Language names should stay in their own script anyway. Verified against the pinned translate.js 3.18.66 in a headless browser with a stubbed service: a service that answers settles on "translated" in 4s, one that fails says so in 4s rather than 12, and one that answers at 16s goes translating → unavailable → translated. tests/js/auto-translate.test.js covers each of those paths; 23/23 pass. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 22 天前 | |
feat(he): publish and integrate the Hebrew edition (#924) * fix(he): publish PDF and EPUB builds * docs(he): integrate Hebrew edition across the project | 20 天前 | |
fix(web): replace native language selector | 1 个月前 | |
fix(web): replace native language selector | 1 个月前 | |
feat(he): publish and integrate the Hebrew edition (#924) * fix(he): publish PDF and EPUB builds * docs(he): integrate Hebrew edition across the project | 20 天前 | |
fix(site): render LaTeX math by adding the missing MathJax 3 config (#721) pymdownx.arithmatex (generic mode) rewrites the book's $...$ and $$...$$ source math into \(...\) / \[...\] wrapped in <span class="arithmatex">, but the MathJax 3 bundle was loaded with no configuration, so it kept its default $...$ delimiters and typeset nothing. Add extras/mathjax.js (loaded before the MathJax bundle) that points MathJax at the arithmatex delimiters/classes and re-typesets after every navigation.instant page swap. | 1 个月前 | |
feat(site): expose 78 experiments in nav + flat fenix-inspired theme The online reading site (deployed from this repo via GitHub Pages) used to show only the 10 chapter prose pages on the left sidebar — the 78 companion experiments under chapterN/ were unreachable without jumping to GitHub. This change surfaces them and gives the whole site a cleaner, flatter look inspired by icyfenix.cn. Build pipeline (scripts/build_site.sh): - Copy chapterN/ experiment dirs into _web/ so MkDocs picks them up - Rewrite ../book/chapterN.md and ../README.md links (GitHub-style) to ../book/chapterN/ and ../ (MkDocs directory URLs), fixing the 404s on the "返回主目录" / "读本章正文" breadcrumb links - Copy assets/ (logo, social images) into _web/assets/, fixing a 404 on the site logo - Drop chapter3/{contextual-retrieval,agentic-rag}/laws/ — 287 bulk legal-doc data files that don't belong in the reading site and were slowing the git-revision-date plugin to a crawl Navigation (mkdocs.yml): - Add a per-chapter entry "第N章 · 配套实验" pointing at chapterN/README.md, so the sidebar stays scannable (10 chapters × 2 entries) instead of being flooded by 78 individual experiment entries - Drop navigation.tabs / tabs.sticky — chapters belong in the left tree like a book, not in a top tab bar - Add Mermaid support via a custom superfences fence (fence_div_format) + mermaid-init.js that re-renders on Material navigation.instant swaps and follows light/dark palette changes - Add the git-revision-date-localized plugin (enable_git_follow=false to silence noisy warnings) and the social plugin for OG cards - Configure search with the ja tokenizer (much better CJK recall than en) - Switch primary colour from indigo to fenix's deep blue-grey #2c3e50 Theme (extras/book-theme.css, assets/logo.svg): - Strip Material's card/shadow/rounded-corner decoration - Match fenix's measured tokens: navbar 57px, sidebar 320px, 1px #eaecef dividers, h1 #2c3e50, body 16px / 1.65 line-height - Add a new SVG logo visualising "Agent = LLM + Context + Tools" - Sensible defaults for tables, code blocks, blockquotes, stat-row, exp-card and homepage hero (verified with Playwright against icyfenix.cn) Homepage (index.md): - Replace the cluttered 4-column table with a 3-card stat row (10章 / 88实验 / 5语言) and a 12-card chapter grid | 1 个月前 | |
fix(web): localize navigation for every edition | 1 个月前 | |
perf(site): split the search index per book edition (#821) * fix(figures): close Chinese numbering gaps and rebuild fig8-1 The Chinese source had reader-visible figure numbering gaps left behind by earlier content removals, and the caption number no longer matched the filename in two chapters. - ch5: restore the 图5-4 embed dropped by d39b1d74 while its prose reference survived, closing the 5-3 -> 5-5 gap. - ch7: retire the two figures the chapter dropped to descriptive names and shift fig7-18/19/20 down so caption number == filename again. - ch10: renumber 10-3..10-13 to 10-2..10-11 across all 13 editions, closing the gaps at 10-2 and 10-10; retire the two removed figures to descriptive names. Drop the dangling "Figure 10-10" reference in the English edition. - Rebuild fig8-1 for the 11 editions still shipping the pre-04c0ed70 artwork. The Chinese source now has gapless, filename-aligned numbering in every chapter with no dangling cross-references. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * perf(site): split the search index per book edition MkDocs' search plugin emits one search_index.json for the whole build. With 13 editions plus the ~94 companion-experiment pages in a single build that file had reached 55 MB, and Material fetches it in full the first time a reader opens search — so everyone downloaded the prose of 12 editions they cannot read. Split it into one file per edition. Each keeps the shared, language-agnostic experiment pages, so search from any edition still reaches the experiments exactly as before; only the other editions' prose is dropped. 55 MB -> 12-15 MB per edition (measured on the current build) scripts/split_search_index.py runs after the search plugin (MkDocs appends hooks: to the plugin list) and rewrites search/ into: search/search_index.json default edition + shared pages search/search_index.<slug>.json one per edition, slug = URL directory Keeping the default edition at the canonical filename means a client that never runs the router — or a stale cached page — degrades to today's behaviour instead of losing search. extras/search-index-router.js picks the matching file in the browser. Material builds the index URL as new URL("search/search_index.json", config.base) and requests it over XMLHttpRequest during bundle.js init; there is no config seam for the path, and extra_javascript loads after bundle.js, so overrides/main.html injects the router in the config block that base.html renders immediately before the bundle. Cross-edition navigation already forces a full reload (lang-switcher.js), so an instant-navigation page swap can never leave a reader on an index for the wrong edition. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 25 天前 | |
docs: add Brazilian Portuguese (pt-BR) translation (#1049) * docs: add Brazilian Portuguese (pt-BR) translation Add book-ptbr/ with complete translation of all 12 chapters (introduction, chapters 1-10, afterword) from the original Chinese with English reference. - 131 translation units, each structurally validated (fenced code, inline code, math, links, images, footnotes, pandoc attributes, heading levels) - Glossary of ~100 technical terms for consistent PT-BR terminology - build_pdf.sh adapted for .ptbr.md files with Portuguese language option - mkdocs.yml: add ptbr language with prefix/suffix/readmeSuffix - build_epub.sh: add ptbr edition with Portuguese metadata - .github/workflows/build-latest.yml: add book-ptbr to triggers, build matrix, and release upload steps - extras/site-nav-i18n.json: add ptbr navigation translations - README.md: add Portuguese (Brasil) to language switcher - README.ptbr.md: new Portuguese landing page with full TOC Translation by Leonardo F. Nascimento (LABHD-UFBA) with AI assistance (GPT-5.6 Sol), structural fidelity validation, and technical glossary. * fix(ptbr): complete edition assets and publication integration - add the full 133-image set and localized PDF helpers - add translated reference answers with structural validation - add the Portuguese site homepage and include book-ptbr in site assembly - localize cover, preamble, cross-references, and question callouts - align EPUB language metadata and remove unsupported experiment indexes - update root documentation and release links for the 15th edition * docs(ptbr): translate figure text in book-ptbr/images to Portuguese Translates the descriptive text inside the ~130 SVG diagrams from English to Brazilian Portuguese, following the same pattern already used by the other translated editions (book-es, book-ja, etc.): only the <text> content changes, layout/structure/coordinates untouched. Code identifiers, product/model names, and technical acronyms are kept in their original form. * docs(ptbr): credit the figure-translation contribution Adds Líbna Raffaely's credit for translating the SVG figure text, alongside Leonardo F. Nascimento's existing translation credit, in README.ptbr.md, index.ptbr.md, and the root README.md language list. Also updates index.ptbr.md's now-outdated note that figures kept their English labels. --------- Co-authored-by: Leonardo F. Nascimento <10790532+leofn@users.noreply.github.com> Co-authored-by: LibnaRaffaely <147429674+LibnaRaffaely@users.noreply.github.com> | 4 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 22 天前 | ||
| 20 天前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 20 天前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 1 个月前 | ||
| 25 天前 | ||
| 4 天前 |