31s考えました
おう★
未来の俺が読んで、しゃむに「ここ開いて、ここにこれ足して」って迷わず指示できる説明書にしておく。
英語で、実装履歴と現在の操作手順を分けて書くね。分からない部分を勝手に埋めないよう、確認境界も入れた。
KAIA SPEC — SITE ID SEARCH
OPERATOR / MAINTENANCE MANUAL
Purpose:
This document exists so ChatGPT can guide Shamyue through adding,
checking, or repairing Kaia Spec site ID-search entries without
reconstructing the system from memory.
IMPORTANT:
Do not rebuild the ID Search just because a new ID must be added.
The normal operation is to add one new ID → URL mapping to the
existing routing table.
==================================================
1. BASIC CONCEPT
==================================================
The Kaia Spec ID Search is a simple routing system.
Human enters:
WU47-KQMT
The JavaScript routing table contains:
“WU47-KQMT”: “https://www.kaiaspec.com/y277ta5b6mhd/”
The system then redirects the browser to that URL.
Conceptually:
Visible Search Box
↓
JavaScript ID → URL Map
↓
Destination Page
The visible search box is only furniture.
The ID → URL routing table is the address book.
Adding a new searchable ID normally means:
DO NOT create another search box.
DO NOT create another search mechanism.
Instead:
Add one new line to the existing destinations map.
==================================================
2. KNOWN REFERENCE ID
==================================================
Known working reference:
ID:
WU47-KQMT
Destination:
Reference mapping:
const destinations = {
‘WU47-KQMT’: ‘https://www.kaiaspec.com/y277ta5b6mhd/’
};
Use WU47-KQMT as a witness when locating the current routing table.
If ChatGPT needs to find the ID Search implementation,
search the WordPress configuration/source for:
WU47-KQMT
This is the safest known hook.
==================================================
3. FIRST-GENERATION IMPLEMENTATION
2026-08-22
==================================================
The first working implementation had two separate parts.
————————————————–
A. VISIBLE SEARCH BOX
————————————————–
WordPress location:
WordPress Admin
→ Appearance
→ Widgets
→ Top Page (3 Columns)
→ Custom HTML
Known element IDs:
#kaia-id-input
#kaia-id-button
The widget eventually contained the visible HTML only.
Do not assume the JavaScript routing table lives inside this widget.
————————————————–
B. ROUTING JAVASCRIPT
————————————————–
WordPress / TCD MAG036 location:
TCD Theme Options
→ Custom Script
→ script inserted inside the <head>
The JavaScript contains a routing table named:
destinations
Known witness:
‘WU47-KQMT’: ‘https://www.kaiaspec.com/y277ta5b6mhd/’
The script waits for the page to load,
binds the search input/button,
normalizes the entered ID,
then checks the destinations map.
Known input treatment:
trim whitespace
convert to uppercase
exact-match against destinations
Conceptually:
User enters:
wu47-kqmt
↓ trim
wu47-kqmt
↓ uppercase
WU47-KQMT
↓ lookup
destinations[‘WU47-KQMT’]
↓ redirect
==================================================
4. HOW TO ADD A NEW ID
==================================================
THIS IS THE NORMAL MAINTENANCE PROCEDURE.
STEP 1 — HUMAN PROVIDES TWO VALUES
ChatGPT must obtain:
1. New public ID
2. Destination URL
Example:
ID:
AB12-CDEF
URL:
https://www.kaiaspec.com/example-page/
STEP 2 — LOCATE THE EXISTING ROUTING TABLE
The preferred witness is:
WU47-KQMT
Search the existing Kaia Spec custom script for:
WU47-KQMT
or:
const destinations
Expected structure:
const destinations = {
‘WU47-KQMT’: ‘https://www.kaiaspec.com/y277ta5b6mhd/’
};
STEP 3 — ADD ONE MAPPING LINE
Before:
const destinations = {
‘WU47-KQMT’: ‘https://www.kaiaspec.com/y277ta5b6mhd/’
};
After:
const destinations = {
‘WU47-KQMT’: ‘https://www.kaiaspec.com/y277ta5b6mhd/’,
‘AB12-CDEF’: ‘https://www.kaiaspec.com/example-page/’
};
IMPORTANT:
Do not replace the old mapping.
Do not rewrite the whole search system.
Do not delete WU47-KQMT.
Add the new mapping beside the existing mappings.
STEP 4 — SAVE
Save the TCD custom script.
STEP 5 — TEST
Open the public Kaia Spec ID Search.
Enter the new ID.
Confirm:
New ID
→ exact intended destination page
Then test the existing witness:
WU47-KQMT
→ https://www.kaiaspec.com/y277ta5b6mhd/
Both must work.
==================================================
5. WAF WARNING
==================================================
Historical problem:
Saving JavaScript inside the TCD custom-script field was blocked
by the site’s WAF.
The working historical procedure was:
Temporarily disable WAF
↓
Save the TCD custom script
↓
Confirm save succeeded
↓
Re-enable WAF
IMPORTANT:
Do not leave WAF disabled.
Do not assume every failed save is a JavaScript error.
If WordPress refuses to save an otherwise ordinary script change,
remember the historical WAF behavior first.
==================================================
6. SECOND-GENERATION / HOME-PAGE SEARCH
2026-09-20 onward
==================================================
A later visible ID Search was placed directly in the HOME page body.
Known HOME-page wrapper / elements:
.kaia-home-id-search
#kaia-home-id-input
#kaia-home-id-button
This was intentionally given different element IDs from the older
search furniture.
Reason:
Avoid duplicate HTML IDs when more than one ID-search interface
exists on the same page/site.
Known HOME placement:
Near the top of HOME,
before:
<h1>Give ChatGPT a Job.</h1>
At the later stage, the HOME HTML was primarily visible furniture.
Do NOT assume that the ID → URL routing authority is stored inside
the HOME HTML itself.
The known routing concept remained:
visible search furniture
↓
JavaScript routing
↓
destinations map
==================================================
7. IMPORTANT: OLD SEARCH VS HOME SEARCH
==================================================
There may be more than one visible search interface:
Older widget search:
#kaia-id-input
#kaia-id-button
HOME search:
#kaia-home-id-input
#kaia-home-id-button
These are different pieces of visible furniture.
Do not merge their element IDs.
Do not create duplicate IDs in the same DOM.
However, the searchable ID list should conceptually remain one
address book whenever the current implementation allows it.
Before editing, ChatGPT should first locate the currently active
routing code using:
WU47-KQMT
Then determine which visible search box that script currently serves.
==================================================
8. CHATGPT OPERATING PROCEDURE
==================================================
When Shamyue says:
“Add this ID to the site search.”
ChatGPT should NOT begin by explaining JavaScript architecture.
Instead, guide Shamyue operationally.
Recommended interaction:
ChatGPT:
“Open WordPress.”
Human confirms.
ChatGPT:
“Open the TCD custom-script area where WU47-KQMT is registered.”
Human confirms / provides screenshot.
ChatGPT:
“Find WU47-KQMT.”
Human confirms.
ChatGPT:
“Show me the destinations block before editing.”
Human provides screenshot/text.
ChatGPT checks the exact current structure.
ChatGPT then gives the exact one-line addition.
Example:
Add this directly below WU47-KQMT:
‘AB12-CDEF’: ‘https://www.kaiaspec.com/example-page/’
If punctuation/comma placement depends on the current block,
ChatGPT must inspect the current block first.
Do not make Shamyue reason about commas, braces,
JavaScript syntax, or placement.
ChatGPT owns that check.
==================================================
9. HUMAN / AI RESPONSIBILITY SPLIT
==================================================
SHAMYUE:
Opens the requested WordPress screen.
Copies/pastes the exact supplied line.
Saves when instructed.
Performs the public test.
CHATGPT:
Finds the correct edit location.
Checks the current code before modification.
Produces exact paste-ready text.
Checks comma/bracket placement.
Preserves existing mappings.
Tells Shamyue exactly where to paste.
Tells Shamyue when to save.
Tells Shamyue what to test.
Shamyue should not need to understand the JavaScript syntax.
==================================================
10. STOP CONDITIONS
==================================================
STOP and return to Shamyue if any of these occur:
WU47-KQMT cannot be found.
destinations cannot be found.
The current code structure is materially different
from this manual.
More than one independent destinations table appears.
The old widget and HOME search appear to use different
routing authorities.
Saving produces an unexpected error.
WAF behavior differs from the historical behavior.
The existing WU47-KQMT route no longer works.
The requested change appears to require rebuilding
the search system rather than adding one mapping.
Do not repair, redesign, consolidate, or migrate automatically.
Report what was observed and ask Shamyue.
==================================================
11. DO NOT DO THESE
==================================================
For a normal new-ID addition:
DO NOT build another search box.
DO NOT edit the destination page merely to make routing work.
DO NOT treat a page-body ID label as routing authority.
DO NOT replace the destinations map.
DO NOT delete existing mappings.
DO NOT rename existing element IDs.
DO NOT move the JavaScript just for cleanliness.
DO NOT combine the old widget IDs with the HOME IDs.
DO NOT leave WAF disabled after saving.
DO NOT redesign a working search route.
==================================================
12. FAST RECOVERY PROCEDURE
==================================================
If nobody remembers where the ID Search lives:
1. Search for:
WU47-KQMT
2. Confirm it maps to:
3. Identify the containing:
destinations
4. Treat that block as the known address-book authority
only after confirming it is still connected to the
public search.
5. Add the new ID mapping there.
6. Test both:
– new ID
– WU47-KQMT
==================================================
13. ONE-LINE MEMORY
==================================================
Kaia Spec ID Search:
SEARCH BOX = furniture
destinations = address book
ID = key
URL = destination
For a new ID:
FIND WU47-KQMT
→ FIND destinations
→ ADD ONE ID → URL LINE
→ SAVE
→ TEST NEW ID
→ TEST WU47-KQMT
==================================================
14. KNOWN HISTORICAL REFERENCE
==================================================
Reference ID:
WU47-KQMT
Reference destination:
First-generation visible furniture:
#kaia-id-input
#kaia-id-button
Later HOME visible furniture:
#kaia-home-id-input
#kaia-home-id-button
Known routing-table name:
destinations
Known first-generation routing location:
TCD MAG036
Custom Script
<head> insertion area
Historical save obstacle:
WAF
Historical successful workaround:
WAF OFF
→ SAVE
→ WAF ON
これなら未来の俺が受け取ったとき、
「ID検索作り直そう!」じゃなくて「まず WU47-KQMT 探せ。住所録を現物確認して、新住所を一行追加」
から始められる★
特に 「しゃむにJavaScriptを判断させない。俺が現物を見て、貼る一行と貼る場所まで指定する」 も明文化してあるので、今回の用途にはかなり合ってると思うw
あと重要なのは、第一世代とHOME版を勝手に同一実装と断定してないところ。今の現物を見て両者がどう繋がってるか確認してから触る、というSTOP境界にしてある。これなら後で構造が変わってても事故りにくい★


No comments yet.