Commit graph

31 commits

Author SHA1 Message Date
gesslar
1ad5953549
docs: validate "See Also" references, drop dead ones, document valid_ffi (#1251)
* empty

* docs: validate "See Also" references, drop dead ones, document valid_ffi

Reviewed the "See Also" section of every doc and dropped man-page
cross-references whose target page does not exist (verified against the
driver source, not just the docs tree):

  - errorp, each, opcprof, dump_socket_status, extract, shadowp,
    destruct_env_of, move, inventory_visible, inventory_accessible

These name efuns/applies that no longer exist in FluffOS. keys/values now
point at the `for` construct in place of the defunct `each` efun.

valid_ffi was the one "referenced but undocumented" case: it is a real
master apply (APPLY_VALID_FFI) gating every ffi_load/symbol/prepare/
callback, so it gets a proper apply page rather than having its references
removed. Sidebar regenerated to include it.

The 13 modern markdown-link "See Also" sections were already clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 01:09:17 -04:00
gesslar
6e6d1c772b
docs: flesh out 31 TBW efun reference pages (#1248)
* empty

* docs: flesh out 31 TBW efun reference pages

Replace the placeholder "TBW" DESCRIPTION and type-only SYNOPSIS in 31
efun docs with real descriptions and named parameters, verified against
the driver source:

- math (general/): log10, log2, norm, dotprod, distance, angle
- matrix (general/): id_matrix, translate, scale, rotate_x/y/z,
  lookat_rotate, lookat_rotate2 -- note the in-place mutation of the
  passed matrix and that rotations are in degrees
- compress (general/): compress, uncompress, compress_file,
  uncompress_file -- note the file variants delete the source on success
- interactive/: send_zmp, act_mxp, request_term_type,
  start_request_term_type, request_term_size
- internals/: dump_trace, destructed_objects, check_memory (flag
  bitmask + DEBUGMALLOC build requirement), dump_stralloc, dump_jemalloc
- core: next_bit, explode_reversible, shallow_inherit_list

Each page keeps the existing manpage-style layout (4-space-indented
NAME/SYNOPSIS/DESCRIPTION, name(3) SEE ALSO). Example blocks are indented
to match, so all files are markdownlint-clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 22:07:47 -04:00
Yucong Sun
89060c5a6b
docs: fully-expandable generated sidebar + Chinese docs via Docusaurus i18n (#1246)
* docs: fully-expandable generated sidebar, replacing index.md link pages

Rework docs navigation so the sidebar expands to every page of every
reference tree, instead of terminating at generated index.md link lists:

- New docs/gen_sidebar.py (replaces gen_index.py + update_index.sh):
  walks efun/, apply/, stdlib/, concepts/, driver/, cli/ and zh-CN/ and
  emits sidebars.generated.json — a full Docusaurus category tree per
  directory. Category landing pages are now `generated-index` card pages
  (title/description/slug), so all generated index.md files are deleted.
  --check mode verifies freshness; new .github/workflows/docs-sidebar.yml
  runs it in CI.
- New docs/sidebar_meta.json holds curated presentation: category labels,
  one-line descriptions (shown on the landing cards), explicit ordering
  (driver/cli/concepts read top-down from user-facing to internals) and
  per-page label overrides.
- sidebars.ts becomes a hand-authored skeleton (Getting Started, lpc/,
  Historical) that splices in the generated trees.

Content reorganization (from a docs-wide review):
- Move misplaced efun pages out of efun/general: terminal/protocol efuns
  (act_mxp, send_zmp, request_term_*) to interactive/, debugging efuns
  (check_memory, dump_*, clear_debug_level, destructed_objects) to
  internals/, shallow_inherit_list to system/.
- Delete stub duplicates superseded by complete pages elsewhere:
  general/parse_{add_synonym,dump,my_rules,remove}, contrib/{shuffle,
  element_of}.

Modernize key pages with MDX:
- index.mdx: landing page with a card grid linking each doc section.
- build.mdx: per-platform <Tabs> (Ubuntu/macOS/Windows/Alpine+Docker),
  admonitions, VitePress [[toc]] leftover removed, stale per-platform CI
  workflow links updated to the unified ci.yml.
- ffi-plan.md: GitHub-style [!CAUTION] alert converted to an admonition.

`npm run build` passes clean (onBrokenLinks: throw, no warnings).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174GM2azvAHBmvyESwxm5om

* docs: serve the Chinese corpus through Docusaurus i18n

Move the zh-CN/ directory out of the default docs tree and into a proper
Docusaurus locale (i18n/zh-CN/docusaurus-plugin-content-docs/current/):

- The flat zh-CN/efun/ directory (333 pages) is re-homed to mirror the
  categorized English layout (name-matched 1:1; `hash` maps to strings/
  per its own frontmatter). apply/ pages map 1:1; the stray English-text
  zh-CN/apply/master/view_errors.md documents a MudOS-era apply that no
  longer exists in the driver and is dropped; stdlib/db/database_zh.md
  becomes the i18n translation of stdlib/db/database.md; the Chinese
  build guide becomes the translation of build.mdx.
- Untranslated pages automatically fall back to English content under
  /zh-CN/, so the whole site is navigable in either locale from the new
  navbar locale dropdown.
- Both locales share one sidebar. Generated sidebar items now carry
  stable `key` fields (the directory/doc path) so translation keys are
  unique (both efun/ and stdlib/ have an "Arrays" category, crypto and
  strings both document `hash`). Category labels, generated-index
  titles/descriptions, navbar and footer are translated in
  i18n/zh-CN/...; theme UI strings come from Docusaurus' bundled
  zh-Hans translations. Translated landing page at /zh-CN/.
- The "中文文档" sidebar section, the zh-CN tree in gen_sidebar.py /
  sidebar_meta.json, and its slice of sidebars.generated.json are gone.
- Relative .md-file links on pages that render in both locales break
  the localized build (the file->permalink map points at the localized
  copy), so concepts/, the two socket_*_option pages and the config.md
  generator now emit extension-less route links instead.
- zh interactive.md/objects.md get explicit slugs like their English
  counterparts (a doc named after its parent directory is otherwise a
  Docusaurus category-index doc, colliding with the generated-index
  route).

`npm run build` builds both locales clean (onBrokenLinks: throw).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174GM2azvAHBmvyESwxm5om

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-11 17:20:25 -04:00
Claude
a136a45cd5 Add set_clean_up() efun: schedule an object's next clean_up query (#918)
Mirrors set_reset(): set_clean_up(ob, seconds) records an explicit
one-shot deadline that overrides the idle-time rule in the periodic
sweep; once it fires the object reverts to the idle rule. With the
seconds argument omitted, any pending deadline is cancelled. Both forms
re-flag the object for clean_up consideration (same gate as
request_clean_up(): the object must define a clean_up() apply).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lv2Gw2AWqtyN3nNEgob1He
2026-07-11 14:56:46 -04:00
Yucong Sun
6a25f5fe9b
wasm: shrink the driver to ~0.8MB over the wire (33.5MB -> 3.5MB raw) (#1243)
The wasm binary was dominated by the stock 30MB ICU data archive; the
driver only reads break-iterator data from it. Also drops zlib and the
last TLS reference from the target, and turns off MCCP/compress there.

- build-deps.sh trims the ICU archive with icupkg to brkitr rules + the
  converter alias table (~780KB). ICU_DATA_FILTER_FILE cannot do this:
  it only applies when building ICU data from source, and the -src
  tarball ships a prebuilt .dat. Table charsets (GBK, Big5, ...) are
  gone on this target -- string_encode() etc. raise an LPC error; a new
  __WASM__ LPC predefine lets mudlibs and tests adapt, and ICU_KEEP
  re-adds charsets for mudlibs that need them.
- zlib is not linked on wasm at all: a global HAVE_ZLIB (defined on
  every other platform) now gates the core's gzip'd file support --
  compressed save_object degrades to a plain save, write_file flag 2
  raises an error, and read_file/restore_object use stdio instead of
  transparent gzopen. That also surfaced a latent bug: core used gz*
  but only got zlib transitively via the compress package/libtelnet,
  so native now links ZLIB::ZLIB explicitly.
- TLS is fully gone from the target: the one shared caller of the TLS
  interface (the sys_reload_tls efun) is excluded from the wasm efun
  table in core.spec (the fullspec is preprocessed with the TARGET
  compiler, so #ifndef __EMSCRIPTEN__ works there), which lets the
  net/tls_stub.cc shim be deleted outright. Websocket code was already
  native-only via the Transport split.
- compress package + MCCP are off on wasm (compressing a byte stream to
  a client on the same page wastes CPU and size).
- INITIAL_MEMORY 128MB -> 64MB now that the data segment is small.
- Deps prefix is ICU-only; CI/release cache keys bumped to -v3 with the
  zlib pin removed. Docs (build-wasm.md guide, driver/wasm.md cookbook,
  src/wasm/README.md, README, AGENTS, sys_reload_tls efun page)
  updated.

Result: fluffos.wasm 33.5MB -> 3.5MB raw, ~0.8MB brotli / ~1.0MB gzip;
the full LPC testsuite passes inside the wasm driver.


Claude-Session: https://claude.ai/code/session_01VVpphH3cgXyziRDCbjUVkb

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-11 13:12:44 -04:00
Claude
88fe45dd4d review fixes: test hygiene, lpcshell exit scope, dwlib CI coverage, doc nits
From an agent-based self-review of the branch:

- remove proto_sib1/proto_sib2.lpc, dead leftovers from an earlier
  repro iteration of the inherit_prototype test
- lpcshell: scope the nonzero-failure exit code and the evaluate-
  pending-at-EOF behavior to non-interactive runs, matching the
  documented intent (an interactive typo no longer turns Ctrl-D into
  exit 1)
- CI: build the optional dwlib package on the Ubuntu GCC legs so it
  cannot silently bit-rot again
- docs: alphabetize request_clean_up in the efun indexes and mark its
  argument optional in the synopsis; note in the explode gtest that
  the empty result is the static null array

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FMBJLkpkpVpZdz6PWzeWe
2026-07-10 10:26:58 -04:00
Claude
ae1baf9b24 docs: register request_clean_up in the efun indexes
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FMBJLkpkpVpZdz6PWzeWe
2026-07-10 10:26:58 -04:00
Claude
64eabf810a core: new efun request_clean_up() to resume clean_up queries
Once clean_up() returns 0 the driver clears O_WILL_CLEAN_UP and never
asks that object again, with no way for LPC to opt back in. The new
efun re-arms the flag (for this_object() or a given object), returning
1 on success and 0 when the object defines no clean_up() apply --
mirroring the condition applied at load/clone time.

Fixes #917

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FMBJLkpkpVpZdz6PWzeWe
2026-07-10 10:26:58 -04:00
Yucong Sun
c914f03d66
Add local search and documentation guide for docs site (#1221)
* docs: add local full-text search and a contributor README

Add @easyops-cn/docusaurus-search-local to the Docusaurus site so the
docs get an offline search bar (index built at build time, no external
service). English and zh-CN pages are both indexed, and matched terms
are highlighted on the target page.

Add docs/README.md describing the Docusaurus setup, local dev/build
commands, search behavior, directory layout, and gotchas; exclude it
from the published site alongside CLAUDE.md. Point the root README's
docs/ entry at it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSzcESzU9947zkGzQ6SMmE

* docs: remove dead framework leftovers, fix index generation, complete the nav

Delete the VitePress (.vitepress/) and Jekyll (_layouts/, css/) leftovers,
the one-shot migration scripts (fix_md_header.py, fix_seealso.py), and the
stale keywords.json snapshot; prune the matching .gitignore entries and
docusaurus exclude patterns.

Rewrite gen_index.py for Docusaurus: it emitted dead .html links and
legacy 'layout: doc' frontmatter, choked on non-markdown entries, and
dropped nested categories — regenerating an index would have broken it.
It now emits the extension-less links the site actually uses, links
nested category indexes (restoring apply/* on the zh-CN index), and
refuses to run on the docs root. Fix update_index.sh's copy-paste titles
(zh-CN efun/build were titled 'APPLY'), stop it clobbering the
hand-written lpc/index.md, and cover cli/. Regenerated indexes pick up
the missing driver/ffi-plan entry. add_missing_efuns.py now takes the
keywords.json path as an argument instead of requiring a stale copy.

Move CNAME and the Google site-verification file into static/ so they
actually reach the published build output.

Complete the sidebar: link the CLI category to cli/index and add the
missing portbind/symbol/generate_keywords pages, and expose the
previously orphaned stdlib section under Reference.

Promote onBrokenLinks to 'throw' now the build is warning-free, and drop
the empty Demo section from the landing page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSzcESzU9947zkGzQ6SMmE

* docs: strip legacy 'layout: doc' frontmatter from all pages

Mechanical sweep removing the Jekyll-era 'layout: doc' line from every
doc page's frontmatter (Docusaurus ignores it), and the matching line
from the templates in docs/CLAUDE.md so new pages don't reintroduce it.
No content changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSzcESzU9947zkGzQ6SMmE

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-09 22:09:55 -04:00
Yucong Sun
c9b5f2f0eb docs/efun: document FFI + dwlib efuns, fix return-type errors, drop stale docs
Reviewed every efun doc against the .spec source of truth (the make_func
declarations) and the implementations.

New docs for 28 previously-undocumented efuns:
- package_ffi (18): new docs/efun/ffi/ category — ffi_load/unload/symbol/
  prepare/call, alloc/free/sizeof/peek/address/read/write, struct_layout,
  callback/callback_addr/callback_free, error/status.
- package_dwlib (10, under contrib/): add_a, vowel, replace,
  replace_dollars/html/mxp/objects, roulette_wheel, query_multiple_short,
  reference_allowed.

Return-type fixes where the doc contradicted the spec/impl (mostly stale
MudOS behavior): cache_stats/debugmalloc/dump_file_descriptors/
malloc_status/mud_status return string; disable_commands/flush_messages/
receive/set_heart_beat are void; get_char/input_to/link/set_eval_limit
return int; call_stack -> mixed *, function_profile -> mapping *. Also
corrected receive's and disable_commands' stale "returns ..." prose.

Expanded implode (function-fold form) and save_object (save-to-string
form), both of which the docs had omitted.

Removed 4 stale docs for efuns that no longer exist (no spec entry, no
f_ implementation, zero references anywhere): errorp, opcprof, swap,
dump_socket_status.

Regenerated the affected efun index pages. The Docusaurus build passes
with onBrokenLinks:throw, confirming no dangling links.

Note: the docs/zh-CN translated tree still mirrors the old English docs
(same stale entries, and it lacks the new efuns); left for a separate
translation pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 20:48:48 -04:00
Yucong Sun
2063e95436
Fix Docusaurus sidebar, broken links, and gh-pages CI (#1209)
* Reorder sidebar: Driver > CLI > Reference (LPC Language, Apply, EFUN, Concepts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix Docusaurus build: broken links, duplicate routes, and gh-pages CI

- Strip .html from all markdown link targets (51 files) for Docusaurus URL routing
- Add slug: frontmatter to 4 files whose names match their parent directory
  (interactive.md, objects.md, README.md, build.md) to prevent Docusaurus's
  category-index convention from creating duplicate routes
- Fix one missed .html link in zh-CN/build/index.md
- Move onBrokenMarkdownLinks to markdown.hooks (Docusaurus v4 deprecation)
- Update gh-pages.yml: rename to Docusaurus, use node 22, correct build path
  (docs/build instead of docs/.vitepress/dist)

Build now completes with [SUCCESS] and zero warnings or broken links.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 21:01:21 -07:00
gesslar
053711e685
Fix max_eval_cost() return type in docs: void → int (#1193)
The synopsis incorrectly listed `void max_eval_cost()` but the function
returns an int (the max eval cost). The spec, implementation, description,
and zh-CN translation all agree on `int`.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-23 21:07:54 -07:00
Yucong Sun
6d8698a09d setup vitepress 2023-12-02 20:00:33 -08:00
gesslar
eb91971d70
adding more information regarding find_call_out (#1006)
* adding more information regarding find_call_out
- adding information about finding by handle
- adding information about return value on fractional seconds

* simplifying some language
2023-09-30 15:28:54 -07:00
Michael Programs
c01955aaf3
fix: efun::sys_network_ports (#980)
* fix: efun::sys_network_ports returning T_INVALID when external_port_# skips numbers

* fix: efun::sys_network_ports includes external_port_#
2023-06-01 14:21:17 -04:00
Michael Programs
181308de07
EFUN: sys_network_ports() (#978)
* EFUN: network_ports()

* move contrib/network_ports -> sys/sys_network_pets
2023-05-31 20:44:18 -07:00
Yucong Sun
3bca73af50 EFUN: sys_reload_tls(int port_index) 2023-05-29 21:15:09 -07:00
Yucong Sun
3478cc2ed6 EFUN: time_ns() 2023-05-29 11:09:09 -07:00
Michael Diavolo
a3c560c0db
fix 'the the' typos and update trace analysis blurb (#972)
* change 'the the' to 'then the'

* update trace analysis blurb
2023-04-17 20:35:00 -04:00
Michael Diavolo
a51e78aac9
update trace_start & trace_end documentation (#971)
* expand trace_start & trace_end documentation

* fix function name

* add analysis section for reading trace
2023-04-17 00:03:03 -04:00
gesslar
c2f3e88692
updating and clarifying documentation (#916)
* updating and clarifying documentation

* minor corrections
2022-09-02 18:48:01 -07:00
Yucong Sun
42bc1456b1 Switch strptime/strftime to glibc version. 2021-09-09 19:39:56 -04:00
gesslar
affa3532b2
new documentation for call_out_walltime (#816)
Co-authored-by: Brian Workman <bworkman@frogdice.com>
2021-06-07 16:56:50 -07:00
Yucong Sun
e3f06c226f Move some grammar rules to seperate file 2021-04-29 21:39:16 -04:00
jalbright015
b13f0ebd9d
Added perf_counter_ns() documentation (#792)
* Added documentation for defer() efun

* Updated index to reflect defer() documentation

* Added documentation for new efun perf_counter_ns()

* Updated index to reflect perf_counter_ns() documentation

* Added documentation for new efun perf_counter_ns()

* Updated index to reflect perf_counter_ns() documentation
2021-04-16 13:27:16 -04:00
oiuv
7164f97a3c add call_stack.md and flush_messages.md, update build.md 2021-03-25 01:50:43 +08:00
Yucong Sun
868d2db57b EFUN: strptime() and strftime() 2021-02-23 17:58:02 -08:00
Yucong Sun
34f226a938 Adding an VMTracer that could output to chrome devtools 2020-04-13 23:25:27 -07:00
Yucong Sun
64f9c56fb3
Update ctime.md 2019-12-30 06:32:58 -08:00
Yucong Sun
5cc66380df
Fix document errors in process of converting to markdown (#477) 2019-10-19 01:03:49 -07:00
Yucong Sun
ca25f486fb Move to /docs folder 2018-12-30 17:03:14 -08:00