TEC Wiki Project State¶
This file is the persistent handoff record for work on the new TEC Wiki at https://tec-wiki.com/.
Future TEC Wiki chats should read this file, inspect the relevant current source page, and review recent related commits before continuing work.
Repository¶
- Repository:
Eternal-City-Community/tec-wiki - Default branch:
main - Primary wiki source:
docs/ - Production site generator: MkDocs Material (
mkdocs build --cleaninwrangler.jsonc; configuration inmkdocs.yml) - Production site: https://tec-wiki.com/
Standing Workflow Rules¶
- When the user says a page is broken, empty, incomplete, incorrect, screwed up, needs restoring, or needs fixing, assume they want the actual wiki build updated, not merely replacement text drafted in chat.
- Inspect the current
docs/<slug>.mdfile before editing. - Use the old TEC Wiki at
eternal-city.wikidot.comas a historical/restoration source when useful. - Do not assume old Wikidot mechanics are current when there is evidence of later changes.
- Current in-game evidence, user testing, GM statements, and confirmed mechanics take precedence over old wiki information.
- Never invent TEC mechanics, ranks, prices, trainer caps, formulas, commands, directions, or effects to fill gaps.
- Clean migration damage as part of restoration:
- broken anchors
- malformed Markdown
- broken internal links
- duplicated sections
- incorrect copied commands
- Wikidot markup remnants
- empty/nearly-empty pages
- broken tables
- Preserve useful real command examples and in-game output when available.
- Internal wiki links should use root-relative format, e.g.
/page-slug/. - Use MkDocs-compatible Markdown consistent with the repository.
- Commit requested page fixes directly to
mainunless the user explicitly requests another workflow. - Report the commit SHA after changes.
- Update this file after significant repairs, confirmed mechanics, or project-wide decisions that future chats may need.
Source Priority¶
When sources disagree, use this order:
- Current user-provided in-game testing/output
- Current GM-confirmed statements
- Current game behavior documented elsewhere in the repo
- Related current TEC Wiki pages
- Old Wikidot material
- Inference only when clearly labeled and never used to invent mechanics
Confirmed Mechanics / Project Knowledge¶
Two-Handed Crushing¶
- Two-Handed Crushing uses 0.25 reputation × the rank being purchased for training cost.
- Do not use the old
30 sens × rankmodel for this skill.
Jewelry Crafting¶
Confirmed from user testing / GM clarification:
- Only skills actually used in a recipe contribute to finished quality.
- Assembly contributes only when the recipe uses assembly.
- Gem-cutting skills do not affect casting quality.
- Captuo teaches the listed jewelry skills through rank 100.
- Skill difficulties:
- Basic Jewelry — Average
- Assemble Jewelry — Average
- Cast Jewelry — Average
- Cold Work Stock — Average
- Engrave Jewelry — Difficult
- Form Wax — Average
- Hot Work Stock — Difficult
- Layout Gem — Average
- Make Mold — Average
- Set Gem — Difficult
- Rough Cut Gem — Average
- Shape Gem — Average
- Polish Gem — Average
- Self-trained SP cost per rank observed:
- Easy — 9
- Average — 12
- Difficult — 15
- Impossible — 18
Recent Repairs¶
Locksmithing¶
- File:
docs/locksmithing.md - Restored/repaired the full Locksmithing page from surviving TEC material.
- Rebuilt the trainer table and skill sections.
- Repaired broken anchors and section links.
- Corrected migrated clay-mold examples that incorrectly repeated
imprint wax with lockpick; they now use the proper clay-mold action. - Preserved useful in-game examples and command syntax.
- Commit:
e6f5957534e63007b7229d4396d42ca2f9285b00
Two-Handed Crushing¶
- File:
docs/two-handed-crushing.md - Skill table repair committed.
- Commit:
5908a8d8321f16615af315b6ea2cfdd64b68483e - Important confirmed rule: training cost is
0.25 reputation × rank purchased.
CMS image upload safeguards (Irisa)¶
- Preserve commit
16345a6ca08b8c6980eb453e6f38e41c417f0183unless intentionally superseding it. - Added
docs/admin/tec-cms-uploads.jsand loaded it fromdocs/admin/index.html. - New media uploads are intercepted before Decap handles them and the editor is prompted to choose a descriptive file name; the original extension is preserved.
- File names are normalized to lowercase letters, numbers, and hyphens. Generic camera/screenshot/hash-style names are treated as meaningless so the editor starts with a blank naming field.
- The upload flow checks both the currently visible media library and the live
/assets/uploads/path. If that exact file name already exists, the upload is refused instead of allowing Decap's replace behavior. This protects existing wiki images from being accidentally overwritten/deleted by a same-name upload. - On page save, the patched GitHub backend filters out newly uploaded media assets that are not actually referenced by the page Markdown. This prevents mistaken/unused uploads from being committed just because they were selected during the edit session.
docs/admin/editor-help.mdwas updated to explain that new images are named before upload and that unused uploads are omitted on save.- Important maintenance note: future Decap/CMS work should not remove or bypass this upload-name interception or the unused-asset filtering without deliberately replacing those safeguards.
Outdoor Survival¶
- File:
docs/outdoor-survival.md - Source content was present, but the rendered page was reported as missing its content.
- Repaired migration/rendering issues conservatively:
- enabled Markdown parsing inside migrated
.skill-templateHTML blocks - removed remaining Wikidot double-brace command markup
- fixed malformed emphasis in rank-note text
- cleaned minor migration typos without changing mechanics
- Commit:
a2d6731ccecf778c9b1ee05ba965e01bcca19e62
MkDocs fenced code support¶
- Enabled the
fenced_codeMarkdown extension globally so restored pages using triple-backtick code blocks render correctly instead of showing literal backticks. - This specifically fixes the Locksmithing formatting issue reported after restoration.
- Commit:
b0c73c18135d56f1bc281bb9157aaf3f63d60e05
Pickpocketing¶
- File:
docs/pickpocketing.md - Source content was present, but the rendered page was reported as empty.
- Repaired migrated
.skill-templateHTML blocks so Markdown inside them is parsed correctly. - Normalized broken/case-sensitive section links to MkDocs-generated heading anchors.
- Did not invent missing Silent Slip / Silent Draw mechanics; those actions are listed in the trainer table but no surviving sections were found in the current source or repository search.
- Commit:
b6eb6b92526100a293fd3e1477fe02b67c30da5b
Production build / Zensical cache¶
- Cloudflare Workers Builds runs
zensical buildfor production, notmkdocs build. - Zensical is pinned at
0.0.66inrequirements.txtand reads the existingmkdocs.ymlin compatibility mode. - Pages such as Outdoor Survival and Pickpocketing had full Markdown sources but rendered as an empty site shell, indicating stale/incorrect generated assets rather than missing source.
wrangler.jsoncnow defines a custom deploy-time build command:zensical build --clean.- This forces a clean Zensical rebuild immediately before Wrangler uploads
./site, avoiding stale Zensical build state in CI. - Commit:
77823450ed5d163297260ca1614fbbea02741880
Known-good rollback: Pickpocketing and Outdoor Survival¶
- On 2026-10-01, repeated render/deploy repair attempts caused unstable behavior for
/pickpocketing/and/outdoor-survival/. - User requested both pages be restored to the last known-good repository state from roughly four hours earlier.
- Exact restore source: repository commit
3b788f91219135ef523973d93cababa2a3df8789, the parent state immediately before the later anchor-repair changes affecting these files. docs/outdoor-survival.mdrestored byte-for-byte to blobf0d7a0880c8e6b2eb12454e319342be5f07826d6.- Restore commit:
30fe754bd27cd4ec2557ffdf4f445b0c0008e9fe docs/pickpocketing.mdrestored byte-for-byte to blobe85cb0c8c157c100350e9b939bd78eb27197b54f.- Restore commit:
e2da0f673dc256a277a59124632a2186ecf944ff - Do not reapply the prior page-specific rendering/anchor edits to these two pages unless a specific root cause is verified first.
Production renderer rollback to MkDocs¶
- Investigation showed
docs/pickpocketing.mdanddocs/outdoor-survival.mdwere byte-for-byte identical to their earlier working versions. - Working skill pages use the same general migrated markup patterns, so the page source itself was not the differentiator.
- The meaningful environment change was the production renderer: earlier working builds used
mkdocs build, while later broken builds usedzensical build. wrangler.jsoncnow forcesmkdocs build --cleanimmediately before asset upload, so the deployedsite/is generated by MkDocs even if an earlier Cloudflare build step runs Zensical.- Commit:
861ee151e818e4b70d650b60caadfb2c8c0e58a5
Grouped skill trainer table styling¶
- The blank-page issue was resolved by restoring MkDocs as the final production renderer.
- After content returned, Pickpocketing and Outdoor Survival showed a separate table-formatting defect: the main trainer table rendered unstyled while ordinary tables rendered correctly.
- Root cause:
tec-skill-pages.jsassigns the classtec-skill-overview-tableto grouped trainer tables, while the base TEC table CSS targeted only.md-typeset table:not([class]). - Added an isolated CSS skin for
.md-typeset table.tec-skill-overview-tableinstead of changing page Markdown or the shared table JavaScript. - A first broad selector patch was immediately superseded because it could distort unrelated selectors.
- Correct fix commit:
96d63bdee4ff8e04ff9ac5260bf069bb368063a0
Skill description truncation: raw <object> placeholders¶
- After restoring MkDocs and fixing grouped trainer table styling, Pickpocketing and Outdoor Survival still appeared to lose later skill-description content.
- Root cause identified in page Markdown: command syntax was written with raw angle-bracket placeholders such as
<object>. Under MkDocs/browser HTML parsing,<object>is a real HTML element, not a harmless placeholder, and an unclosed occurrence can absorb later page content in the DOM. - Working skill pages often use placeholders such as
<target>, which do not trigger the same built-in HTML element behavior. - Escaped command placeholders in skill headings so the literal syntax displays without becoming HTML.
- Also escaped the Pickpocketing
unpalm <object>prose command and remaining Outdoor Survival<object>placeholders. - Pickpocketing fix commit:
62db7233c06a3b2e0a96d8e5bb8a4c35641cedc3 - Outdoor Survival fix commit:
c76dc3a73ebbe51381f0e440bfa0399e3b4ae78b - The Pickpocketing source still has no surviving detailed sections for Silent Slip or Silent Draw; do not invent those mechanics.
- Superseded by a build step:
hooks/placeholders.pyescapes any<word>that is not an HTML tag the pages use, so pages keep plain<target>,<object>and the like (the CMS shows<literally and saves typed<raw).docs/admin/tec-cms-placeholders.jsdoes the same for the editor preview. Unescaped placeholders also hid in the search index, where the rest of a section became part of its heading. Only<label>and<mark>, which are real tag names, stay escaped in the pages.
Outdoor Survival tail rebuilt as plain Markdown¶
- User reported that live rendering still stopped after Forester Conceal, even though the repository contained Survival Weaving, Whittling, and lore sections.
- The break point aligned with the remaining legacy raw-HTML tail of the page.
- Rebuilt everything from Survival Weaving onward as plain MkDocs Markdown:
- converted legacy
<a id=...>anchors to heading attr-list IDs - converted
.skill-templateraw HTML blocks to fenced text blocks - converted collapsible
<details markdown="1">rank sections to normal visible Markdown sections/tables - preserved all existing descriptions, tables, command examples, and lore content
- Commit:
545561bd29b299af238f10700d1643e710cd94bf
Migration presentation cleanup batch¶
User-reported issues and fixes on 2026-10-01:
- Character bios: migrated bio pages had inconsistent/broken quote markup. Added
docs/javascripts/tec-content.jsto normalize/bio_*/pages into a single quote-style biography frame at runtime without rewriting hundreds of source files. - Commit:
0f8a9adfe1418f509a0fb8a280ac50eea6133143 - Skill example spacing: normalized blank source lines inside migrated
.skill-templateblocks and trimmed leading/trailing whitespace. - Commits:
bcc5af28190cbafc4741b52d32d67663ea59d618,191284a01a5ab49668d70d7caa643ac5a3d61aae - Legacy single-line breaks: enabled the Markdown
nl2brextension because many migrated map legends, related-map lists, and guide instructions preserve meaningful single newlines in source. - Commit:
53f6d03da63f4dd104d703f52456c9ba49a97c17 - H5 readability: added distinct, larger fifth-level heading styling.
- Map images: linked images may use the full article-column width instead of the prose-width cap, and linked image/map assets now open in a new tab.
- Top navigation: removed the old CSS rule that completely hid the TEC top navigation below the desktop breakpoint; compact responsive navigation remains available on narrow desktop and mobile.
- Shared styling commit:
4e59a2eaf52a613fc3275356a1a0c12b6b5d0303 - Maps index: restored concrete map links under the regional headings in
docs/maps.mdusing known current wiki map pages. - Commit:
ef3066001becbbc26727403a2c3cc37e21f05c1c - Rank Bonus Calculator: allow calculations when either basics or subskill input is present rather than suppressing combat output when subskill is empty; seeded the calculator with the classic defaults of basics 10 / subskill 1 so combat results display immediately.
- Commits:
76cf6d9ed4fade917b407c36377156e9f8464261,793e8b2f4e1c672458ec7ccb327712f44e951a76 - User also expressed a preference concern about the current
+button behavior; that interaction has not been redesigned yet. - Announcements / ListPages: the old Announcements page used a Wikidot
ListPagesmodule whose generated content was not captured by migration. Replaced the raw technical warning with a clearer restoration note, but the actual historical announcement index still needs reconstruction from archived Wikidot source. - Announcements note commit:
3cf922d0c5fb7457ca4026f95071f14bc9c900e6 - Migration audit: updated
tools/audit_migration.pyto flagArchive note:andWikidot modulemarkers so remaining dynamic-module losses are visible in future audits. - Commit:
3533db56834eda4581ee954285bbb2b0f2538ddc
Rank Bonus Calculator classic functionality restoration¶
- User confirmed Offensive and Defensive modes still rendered blank while Non-Combat worked.
- Root cause: combat stance rows were represented as arrays, but the renderer read
row.mod; only Non-Combat used an object with a validmodproperty. This producedNaN/blank combat results. - Rebuilt
docs/javascripts/tec-rank-bonus.jsaround a consistent calculator-card model while preserving the polished UI. - Restored the original Wikidot calculation behavior:
- Basic column uses raw RB for the entered Basics rank.
- Easy/Average/Difficult/Impossible subskills use
floor(Basics RB) × difficulty modifier + Subskill RB. - Combat stance modifier is applied to the calculated RB.
- Defensive mode uses the inverse stance modifiers.
- Non-combat uses 100% stance modifier.
- Restored the original
RB +/- Modfield; the modifier is applied after stance to subskill results, matching the classic calculator. - Restored
+behavior: clicking+now creates a complete independent copy of the first calculator box, including its current ranks, modifier, mode, row/column settings, and decimal precision. The temporary one-line comparison widget was removed. - Main functionality commit:
fe2d9a9ef388a3b8bd08dc178641a70a074d75af - Duplicate-card spacing/style commit:
0f54ee779872904bf95d2fc5028d0df281dbc4c2
RB calculator input parity correction¶
- User provided screenshots of the Wikidot calculator and current rebuilt calculator.
- The target Wikidot UI has only Basics Rank and Subskill Rank inputs; the previously restored third
RB +/- Modfield came from an older preserved source variant and should not be present in the rebuilt UI. - Removed the third modifier input and modifier math from the current calculator.
-
Removed the default
10 / 1ranks; both inputs now start blank, matching the Wikidot calculator shown by the user... -
2026-10-15 biography portrait atomic publication: In response to Irisa's CMS image-safety changes (commit
16345a6ca08b8c6980eb453e6f38e41c417f0183), kept biography portrait filenames automatically derived from the character slug and owner-code verification. AddedpublishPortraitAtomicinsrc/bio-portrait.js(df0db59) and switched/api/bio/portraitinsrc/worker.js(b76eddf) to create a single Git commit containing both portrait blob and biography Markdown reference; when replacing a portrait with a different extension, the previously referenced asset is deleted in the same commit if present. A failed/non-fast-forward ref update should leave only unreachable Git objects, not orphan files onmain. Does not modify Irisa's Decap CMS upload safeguards. Live upload/replacement and concurrency behavior have not yet been retested after this change; verify Cloudflare deployment and GitHub Actions before claiming operational success. -
2026-10-15 automated biography test maintenance: GitHub Actions
Validate TEC Wikiwas failing 19/65 tests: obsolete launch-gate expectations, retired diagnostic probe endpoint expectations, and outdated portrait overwrite mock. Updatedtests/biography-gates.test.mjs(352a131) to verify live feature configuration, GET method restrictions and retired diagnostic routes; updatedtests/biography-portrait.test.mjs(fb6ef77) to model existing portrait SHA and replacement. No production behavior or protections were disabled. Await a fresh GitHub Actions run to confirm green; do not assume tests passed yet. -
2026-10-15 live atomic portrait upload verification: User tested on Veridio DiMori's real biography. Same-format PNG replacement commit
50707c0changed onlydocs/assets/uploads/bio_veridio_dimori.png(one commit). PNG→JPG replacement commitbae903aatomically addeddocs/assets/uploads/bio_veridio_dimori.jpg, deleted the old.png, and updateddocs/bio_veridio_dimori.mdto reference.jpg(three file changes in one commit). User confirmed public portrait updated and Cloudflare deployment succeeded. Both live positive-path tests passed. Original Veridio portrait has NOT yet been restored as of this note; user should restore it using biography Edit Bio portrait upload. Concurrency/failure-path behavior has not been live tested. -
2026-10-15 player-fiction storybook proof of concept: User requested a separate, working low-fantasy parchment/gold storybook page using the existing
/journey-rock-valley/content, without altering the original and without creating 20 individual editor pages. Addeddocs/journey-rock-valley-storybook.md(329dcb3), a single Markdown document copied from the original with its---chapter separators;docs/javascripts/tec-storybook.js(d041d82) turns separators into paged reader panels with Previous/Next, chapter selector, keyboard arrows, all-pages mode, and print-friendly fallback; scoped CSSdocs/stylesheets/tec-storybook.css(ea81c2f); assets registered inmkdocs.yml(570c6aa). Prototype URL/journey-rock-valley-storybook/. No global visual redesign and no CMS submission form or automatic author pagination implemented. Review responsive behavior and Cloudflare deployment before extending to other stories. Preserve original story text and page. -
2026-10-15 storybook visual implementation: User explicitly requested implementing the illustrated mockup on the actual
/journey-rock-valley-storybook/prototype, not generating another image. Added hand-authored scalable botanical filigree assetdocs/assets/storybook-filigree.svg(5e1eeef), applied dark leather-textured folio header, gold ornaments, weathered parchment and four corner assets to scopeddocs/stylesheets/tec-storybook.css(1683093,7b22ae5). No sitewide redesign. Preserve normal wiki body typography, single Markdown source and original/journey-rock-valley/, responsive sizing, longest-chapter height stability, no inner scrollbar, chapter select, page dots and All pages mode. Live browser appearance not yet verified.
2026-10-16 build performance audit¶
- Production is MkDocs Material, not Zensical;
wrangler.jsoncrunsmkdocs build --clean, andrequirements.txtno longer includes Zensical (Phase 1 commit8980acc). Older Zensical descriptions above are historical, not current. - Cloudflare rollout history shows Phase 1 deployment ready in approximately 57 seconds; individual earlier builds vary widely.
- Reviewed all 11 MkDocs hooks.
hooks/page_history.pyreads full Git patch history andhooks/whats_new.pyreads Git history; these are plausible costs, not yet proven bottlenecks. Keep their output intact. - Phase 2 initial low-risk change: cache
TEC_LISTPAGESparent lookup within a single build to avoid repeated recursive Markdown scans for the same parent; clear cache on every build. Add elapsed-time informational logging for the page-history and What's New post-build hooks so the next Cloudflare log can show actual costs. - Do not disable history, navigation, previews, or full clean builds merely for speed; measure before more aggressive changes.
2026-10-16 Git history fetch optimization¶
- Preserve full history for What's New and Page History. Both hooks now use
git fetch --unshallow --no-tags --no-write-fetch-headwhen the checkout is shallow, avoiding unnecessary tag negotiation and FETCH_HEAD writes while retaining the complete commit/patch history. - Added fetch timing to the Page History fallback path. What's New already logs its fetch time.
- Measure the next Cloudflare deployment before claiming any speedup; network fetch remains a likely variable cost. Avoid shortening history because page revisions must remain complete.
2026-10-16 MkDocs page-processing optimization¶
hooks/listpages.pynow indexes front-matter parent relationships in one Markdown directory traversal per build, instead of one traversal per distinctTEC_LISTPAGESparent. Preserve the original Markdown list output, title extraction, slug ordering, and empty-index behavior.- Cache resets on every
on_pre_build. Check next Cloudflare log for total MkDocs timing; no performance improvement is claimed until measured.
Phase 1 reliability improvements (2026-10-16)¶
- Added read-only
tools/check_wiki_integrity.pyto report missing root-relative pages/assets, missing parent slugs, unclosed front matter and duplicate explicit HTML anchors. Validation workflow runs it in informational mode to avoid blocking builds on existing migration findings; use--strictafter baseline cleanup. - Added opt-in
python tools/profile_build.pyto profile MkDocs CPU time without modifying production build behavior. - Historical migration audits are manual and read-only. Legacy migration repair/rollback workflows are manual-only to avoid unintended changes and extra Cloudflare deployments.
- No Wikidot assets or gameplay pages were changed.
2026-10-16 intentional red-link audit policy¶
- Missing wiki pages are intentional Wikidot-style red links, not broken content.
docs/assets/data/missing-pages.jsonenumerates missing slugs;docs/javascripts/tec-content.jsstyles matching links and sends editors to/admin/#/collections/pages/new. Preserve this behavior. Previous migration removed empty placeholder Markdown pages to make red links work. - Do not automatically rewrite red links to nearby pages, remove them, or create empty Markdown stubs merely to silence validation. Some are planned biography, combat, lore and hunting-ground pages.
tools/check_wiki_integrity.pynow reports missing wiki-page references separately as informational; checks broken redirects, missing assets, malformed destinations, manifest drift, and existing structural issues as actual findings.--strictfails only on actual issues. Validator remains informational until existing legitimate issues are triaged.tests/test_wiki_integrity.pychecks intentional missing-page behavior, manifest coverage, stale manifest entries, broken assets/redirects, and the red-link editor JavaScript contract. Run withpython -m unittest discover -s tests -p 'test_wiki_integrity.py'.
2026-10-16 Markdown hook fast paths¶
- Three Markdown hooks now skip work on pages without their relevant marker: skill samples, command placeholders, and star-list spacing. No formatting rules were removed.
- Added unit tests in
tests/test_hook_fast_paths.pyand included them in validation. These guards may save small amounts of per-page work; benchmark before claiming a speedup. Markdown conversion and search indexing remain the larger measured costs.
2026-10-17 Veteran Characters prototype removal¶
- The review-only
/veteran-characters-prototype/was rejected by the user and its source file deleted. - Keep
docs/veteran-characters.mdunchanged; do not reuse or reinstate that prototype without a new request.