ops-wiki-agent-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/agents/docs-target-catalog.agent.md +52 -0
- package/.github/agents/docs-target-queue-from-catalog.agent.md +34 -0
- package/.github/agents/source-code-to-spec-documenter.agent.md +39 -0
- package/.github/agents/source-code-to-spec-reviewer.agent.md +51 -0
- package/.github/agents/source-code-to-system-ops-overview.agent.md +39 -0
- package/.github/prompts/00-generate-target-all-spec.prompt.md +35 -0
- package/.github/prompts/01-generate-target-foundation-spec.prompt.md +35 -0
- package/.github/prompts/02-generate-target-architecture-spec.prompt.md +35 -0
- package/.github/prompts/03-generate-target-ops-spec.prompt.md +35 -0
- package/.github/prompts/04-review-target-spec.prompt.md +24 -0
- package/.github/prompts/docs-target-catalog.prompt.md +32 -0
- package/.github/prompts/docs-target-queue-from-catalog.prompt.md +28 -0
- package/.github/prompts/generate-system-ops-overview.prompt.md +62 -0
- package/.github/skills/database-query/SKILL.md +140 -0
- package/.github/skills/database-query/references/client-commands.md +189 -0
- package/.github/skills/database-query/references/query-safety.md +109 -0
- package/.github/skills/database-query/scripts/find_db_config.py +273 -0
- package/.github/skills/docs-target-catalog/SKILL.md +194 -0
- package/.github/skills/docs-target-catalog/references/docs-target-queue-conversion.md +164 -0
- package/.github/skills/docs-target-catalog/references/entrypoint-source-patterns.md +83 -0
- package/.github/skills/docs-target-catalog/references/output-templates.md +168 -0
- package/.github/skills/docs-target-queue-from-catalog/SKILL.md +255 -0
- package/.github/skills/docs-target-queue-from-catalog/references/docs-target-queue-contract.md +125 -0
- package/.github/skills/docs-target-queue-from-catalog/references/metadata-acquisition-patterns.md +149 -0
- package/.github/skills/docs-target-queue-from-catalog/scripts/write_documentation_target_queue.py +527 -0
- package/.github/skills/source-code-to-ops-spec-guidelines/SKILL.md +128 -0
- package/.github/skills/source-code-to-ops-spec-guidelines/references/01-system-overview-and-business-scenarios-guideline.md +172 -0
- package/.github/skills/source-code-to-ops-spec-guidelines/references/02-core-architecture-flow-data-logic-guideline.md +637 -0
- package/.github/skills/source-code-to-ops-spec-guidelines/references/03-error-ops-scenario-coverage-guideline.md +533 -0
- package/.github/skills/source-code-to-ops-spec-guidelines/references/supporting-output-format-diagram-and-example-reference.md +523 -0
- package/.github/skills/source-code-to-spec-documenter/SKILL.md +80 -0
- package/.github/skills/source-code-to-spec-documenter/references/generation-handoff-contract.md +155 -0
- package/.github/skills/source-code-to-spec-documenter/references/generation-workflow.md +184 -0
- package/.github/skills/source-code-to-spec-documenter/references/source-tracing-rules.md +271 -0
- package/.github/skills/source-code-to-spec-documenter/references/target-queue-contract.md +78 -0
- package/.github/skills/source-code-to-spec-documenter/scripts/spec_queue.py +222 -0
- package/.github/skills/source-code-to-spec-tools/SKILL.md +117 -0
- package/.github/skills/source-code-to-spec-tools/references/repository-artifact-contract.md +122 -0
- package/.github/skills/source-code-to-spec-tools/references/target-queue-schema-contract.md +116 -0
- package/.github/skills/source-code-to-spec-tools/references/terminology-contract.md +121 -0
- package/.github/skills/source-code-to-spec-tools/scripts/catalog_query.py +324 -0
- package/.github/skills/source-code-to-spec-tools/scripts/queue_contract.py +210 -0
- package/.github/skills/source-code-to-spec-tools/scripts/source_lookup.py +360 -0
- package/.github/skills/source-code-to-spec-tools/scripts/target_query.py +407 -0
- package/.github/skills/source-code-to-system-ops-overview/SKILL.md +82 -0
- package/.github/skills/source-code-to-system-ops-overview/references/system-operations-overview-guideline.md +332 -0
- package/README.md +116 -0
- package/ops-wiki-agent-kit.js +173 -0
- package/package.json +22 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
sys.dont_write_bytecode = True
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import re
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
SKIP_DIRS = {
|
|
14
|
+
".git",
|
|
15
|
+
".hg",
|
|
16
|
+
".svn",
|
|
17
|
+
".idea",
|
|
18
|
+
".vscode",
|
|
19
|
+
"__pycache__",
|
|
20
|
+
"node_modules",
|
|
21
|
+
"target",
|
|
22
|
+
"build",
|
|
23
|
+
"dist",
|
|
24
|
+
"out",
|
|
25
|
+
".gradle",
|
|
26
|
+
".mvn",
|
|
27
|
+
"vendor",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
SCRIPT_SKILL_DIR = Path(__file__).resolve().parents[1]
|
|
31
|
+
|
|
32
|
+
TEXT_EXTENSIONS = {
|
|
33
|
+
".properties",
|
|
34
|
+
".yml",
|
|
35
|
+
".yaml",
|
|
36
|
+
".xml",
|
|
37
|
+
".json",
|
|
38
|
+
".env",
|
|
39
|
+
".ini",
|
|
40
|
+
".conf",
|
|
41
|
+
".cfg",
|
|
42
|
+
".toml",
|
|
43
|
+
".sql",
|
|
44
|
+
".java",
|
|
45
|
+
".kt",
|
|
46
|
+
".groovy",
|
|
47
|
+
".cs",
|
|
48
|
+
".js",
|
|
49
|
+
".ts",
|
|
50
|
+
".py",
|
|
51
|
+
".rb",
|
|
52
|
+
".php",
|
|
53
|
+
".sh",
|
|
54
|
+
".ps1",
|
|
55
|
+
".bat",
|
|
56
|
+
".cmd",
|
|
57
|
+
".txt",
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
CONFIG_EXTENSIONS = {
|
|
61
|
+
".properties",
|
|
62
|
+
".yml",
|
|
63
|
+
".yaml",
|
|
64
|
+
".xml",
|
|
65
|
+
".json",
|
|
66
|
+
".env",
|
|
67
|
+
".ini",
|
|
68
|
+
".conf",
|
|
69
|
+
".cfg",
|
|
70
|
+
".toml",
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
TEXT_NAMES = {
|
|
74
|
+
"Dockerfile",
|
|
75
|
+
"Jenkinsfile",
|
|
76
|
+
"docker-compose.yml",
|
|
77
|
+
"docker-compose.yaml",
|
|
78
|
+
"pom.xml",
|
|
79
|
+
"build.gradle",
|
|
80
|
+
"build.gradle.kts",
|
|
81
|
+
"package.json",
|
|
82
|
+
"requirements.txt",
|
|
83
|
+
"persistence.xml",
|
|
84
|
+
"context.xml",
|
|
85
|
+
"tnsnames.ora",
|
|
86
|
+
"pg_service.conf",
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
CONFIG_NAMES = TEXT_NAMES | {
|
|
90
|
+
".env",
|
|
91
|
+
".env.local",
|
|
92
|
+
".env.dev",
|
|
93
|
+
".env.test",
|
|
94
|
+
".env.prod",
|
|
95
|
+
"application.properties",
|
|
96
|
+
"application.yml",
|
|
97
|
+
"application.yaml",
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
DB_PATTERNS = [
|
|
101
|
+
("oracle", re.compile(r"jdbc:oracle:thin|oracle\.jdbc|tnsnames\.ora|SERVICE_NAME|ORACLE_SID", re.I)),
|
|
102
|
+
("postgresql", re.compile(r"jdbc:postgresql|org\.postgresql|PGHOST|PGDATABASE|postgres(?:ql)?://", re.I)),
|
|
103
|
+
("sqlserver", re.compile(r"jdbc:sqlserver|com\.microsoft\.sqlserver|sqlcmd|Data Source=|Initial Catalog=", re.I)),
|
|
104
|
+
("mysql", re.compile(r"jdbc:mysql|com\.mysql|mysql://|MYSQL_", re.I)),
|
|
105
|
+
("mariadb", re.compile(r"jdbc:mariadb|org\.mariadb|mariadb://|MARIADB_", re.I)),
|
|
106
|
+
("db2", re.compile(r"jdbc:db2|com\.ibm\.db2|DB2", re.I)),
|
|
107
|
+
("sqlite", re.compile(r"jdbc:sqlite|sqlite3?|\.db\b|\.sqlite\b", re.I)),
|
|
108
|
+
("h2", re.compile(r"jdbc:h2|org\.h2|H2_", re.I)),
|
|
109
|
+
]
|
|
110
|
+
|
|
111
|
+
CONFIG_KEY_PATTERN = re.compile(
|
|
112
|
+
r"(?i)("
|
|
113
|
+
r"spring\.datasource\.[\w.-]+|"
|
|
114
|
+
r"datasource\.[\w.-]+|"
|
|
115
|
+
r"r2dbc\.[\w.-]+|"
|
|
116
|
+
r"hibernate\.connection\.[\w.-]+|"
|
|
117
|
+
r"database[_\-.]?\w*|"
|
|
118
|
+
r"db[_\-.]?(host|port|name|user|username|password|passwd|pwd|url|schema)|"
|
|
119
|
+
r"jdbc[_\-.]?\w*|"
|
|
120
|
+
r"connection(string)?|"
|
|
121
|
+
r"url|username|user|password|passwd|pwd|host|port|schema|service_name|sid|"
|
|
122
|
+
r"PGHOST|PGPORT|PGDATABASE|PGUSER|PGPASSWORD|"
|
|
123
|
+
r"MYSQL_HOST|MYSQL_PORT|MYSQL_DATABASE|MYSQL_USER|MYSQL_PASSWORD|"
|
|
124
|
+
r"MARIADB_HOST|MARIADB_PORT|MARIADB_DATABASE|MARIADB_USER|MARIADB_PASSWORD|"
|
|
125
|
+
r"ORACLE_HOST|ORACLE_PORT|ORACLE_SERVICE|ORACLE_SID|"
|
|
126
|
+
r"SQLSERVER_HOST|SQLSERVER_PORT|SQLSERVER_DATABASE|SQLSERVER_USER|SQLSERVER_PASSWORD"
|
|
127
|
+
r")"
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
NON_CONFIG_HINT_PATTERN = re.compile(
|
|
131
|
+
r"(?i)("
|
|
132
|
+
r"jdbc:[\w:]+|"
|
|
133
|
+
r"postgres(?:ql)?://|mysql://|mariadb://|"
|
|
134
|
+
r"Data Source=|Initial Catalog=|"
|
|
135
|
+
r"PGHOST|PGDATABASE|MYSQL_|MARIADB_|ORACLE_|SQLSERVER_|"
|
|
136
|
+
r"tnsnames\.ora|sqlplus|sqlcmd|sqlite3|db2 connect"
|
|
137
|
+
r")"
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
SECRET_KEY_PATTERN = re.compile(r"(?i)(password|passwd|pwd|secret|token|credential|private[_-]?key|access[_-]?key)")
|
|
141
|
+
USERNAME_KEY_PATTERN = re.compile(r"(?i)(^|[_.-])(user|username|uid)$|(^|[_.-])(user|username|uid)([_.-]|$)")
|
|
142
|
+
ASSIGNMENT_PATTERN = re.compile(r"^\s*([^#;!\s][^:=\s]*?)\s*[:=]\s*(.+?)\s*$")
|
|
143
|
+
MAX_FILE_BYTES = 2 * 1024 * 1024
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def is_text_candidate(path):
|
|
147
|
+
return path.name in TEXT_NAMES or path.suffix in TEXT_EXTENSIONS or path.name.startswith(".env")
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def is_config_file(path):
|
|
151
|
+
return path.name in CONFIG_NAMES or path.suffix in CONFIG_EXTENSIONS or path.name.startswith(".env")
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def detect_db_type(text):
|
|
155
|
+
matches = [name for name, pattern in DB_PATTERNS if pattern.search(text)]
|
|
156
|
+
return ",".join(matches) if matches else ""
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def redact_value(key, value):
|
|
160
|
+
value = value.strip().strip("\"'")
|
|
161
|
+
if SECRET_KEY_PATTERN.search(key):
|
|
162
|
+
return "<redacted>"
|
|
163
|
+
if USERNAME_KEY_PATTERN.search(key):
|
|
164
|
+
return "<redacted-user>"
|
|
165
|
+
|
|
166
|
+
redacted = value
|
|
167
|
+
redacted = re.sub(r"(?i)(password|passwd|pwd)=([^;&\s]+)", r"\1=<redacted>", redacted)
|
|
168
|
+
redacted = re.sub(r"(?i)(user(?:name)?\s*=\s*)([^;&\s]+)", r"\1<redacted-user>", redacted)
|
|
169
|
+
redacted = re.sub(r"(?i)(uid\s*=\s*)([^;&\s]+)", r"\1<redacted-user>", redacted)
|
|
170
|
+
redacted = re.sub(r"(?i)(User ID\s*=\s*)([^;&]+)", r"\1<redacted-user>", redacted)
|
|
171
|
+
redacted = re.sub(r"(?i)(Password\s*=\s*)([^;&]+)", r"\1<redacted>", redacted)
|
|
172
|
+
redacted = re.sub(r"://([^:/@\s]+):([^@\s]+)@", r"://<redacted-user>:<redacted>@", redacted)
|
|
173
|
+
return redacted
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def iter_files(root):
|
|
177
|
+
for current_root, dirs, files in os.walk(root):
|
|
178
|
+
dirs[:] = [d for d in dirs if d not in SKIP_DIRS]
|
|
179
|
+
for name in files:
|
|
180
|
+
path = Path(current_root) / name
|
|
181
|
+
try:
|
|
182
|
+
path.resolve().relative_to(SCRIPT_SKILL_DIR)
|
|
183
|
+
continue
|
|
184
|
+
except ValueError:
|
|
185
|
+
pass
|
|
186
|
+
if is_text_candidate(path):
|
|
187
|
+
yield path
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def scan_file(path, root):
|
|
191
|
+
try:
|
|
192
|
+
if path.stat().st_size > MAX_FILE_BYTES:
|
|
193
|
+
return []
|
|
194
|
+
content = path.read_text(encoding="utf-8", errors="replace")
|
|
195
|
+
except OSError:
|
|
196
|
+
return []
|
|
197
|
+
|
|
198
|
+
results = []
|
|
199
|
+
rel_path = str(path.relative_to(root))
|
|
200
|
+
config_file = is_config_file(path)
|
|
201
|
+
for line_no, line in enumerate(content.splitlines(), start=1):
|
|
202
|
+
db_type = detect_db_type(line)
|
|
203
|
+
key = ""
|
|
204
|
+
value = line.strip()
|
|
205
|
+
match = ASSIGNMENT_PATTERN.match(line)
|
|
206
|
+
|
|
207
|
+
if match:
|
|
208
|
+
key = match.group(1).strip()
|
|
209
|
+
value = match.group(2).strip()
|
|
210
|
+
key_match = CONFIG_KEY_PATTERN.search(key)
|
|
211
|
+
if not db_type and not (config_file and key_match):
|
|
212
|
+
continue
|
|
213
|
+
else:
|
|
214
|
+
hint_match = NON_CONFIG_HINT_PATTERN.search(line)
|
|
215
|
+
if not db_type and not hint_match:
|
|
216
|
+
continue
|
|
217
|
+
if hint_match:
|
|
218
|
+
key = hint_match.group(1)
|
|
219
|
+
|
|
220
|
+
if not db_type:
|
|
221
|
+
db_type = detect_db_type(value)
|
|
222
|
+
|
|
223
|
+
results.append(
|
|
224
|
+
{
|
|
225
|
+
"file": rel_path,
|
|
226
|
+
"line": line_no,
|
|
227
|
+
"db_type": db_type or "unknown",
|
|
228
|
+
"key": key,
|
|
229
|
+
"value": redact_value(key, value),
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
return results
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def print_markdown(results):
|
|
236
|
+
if not results:
|
|
237
|
+
print("No DB config candidates found.")
|
|
238
|
+
return
|
|
239
|
+
|
|
240
|
+
print("| file | line | db_type | key | redacted_value |")
|
|
241
|
+
print("| --- | ---: | --- | --- | --- |")
|
|
242
|
+
for item in results:
|
|
243
|
+
value = item["value"].replace("|", "\\|")
|
|
244
|
+
key = item["key"].replace("|", "\\|")
|
|
245
|
+
print(f"| {item['file']} | {item['line']} | {item['db_type']} | `{key}` | `{value}` |")
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def main():
|
|
249
|
+
parser = argparse.ArgumentParser(description="Find DB connection config candidates with redacted output.")
|
|
250
|
+
parser.add_argument("repo", nargs="?", default=".", help="Repository path to scan.")
|
|
251
|
+
parser.add_argument("--json", action="store_true", help="Output JSON instead of markdown.")
|
|
252
|
+
args = parser.parse_args()
|
|
253
|
+
|
|
254
|
+
root = Path(args.repo).resolve()
|
|
255
|
+
if not root.exists():
|
|
256
|
+
print(f"Path does not exist: {root}", file=sys.stderr)
|
|
257
|
+
return 2
|
|
258
|
+
|
|
259
|
+
results = []
|
|
260
|
+
for path in iter_files(root):
|
|
261
|
+
results.extend(scan_file(path, root))
|
|
262
|
+
|
|
263
|
+
results.sort(key=lambda item: (item["file"], item["line"]))
|
|
264
|
+
|
|
265
|
+
if args.json:
|
|
266
|
+
print(json.dumps(results, indent=2, ensure_ascii=False))
|
|
267
|
+
else:
|
|
268
|
+
print_markdown(results)
|
|
269
|
+
return 0
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
if __name__ == "__main__":
|
|
273
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-target-catalog
|
|
3
|
+
description: 依 source code 盤點 repo 的 documentation targets,例如 menu/navigation target、API、job、command、screen、report、integration 與其他可直接觸發的 entrypoint。當使用者要建立 source-backed target catalog,或區分 top-level target 與 CRUD、view、helper、dialog 等附屬檔案時使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Target Catalog
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
先從 activation surface 建立 documentation target catalog,再用檔案作為佐證。除非 source evidence 明確顯示該檔案可被獨立觸發,否則不要把 file type、filename 或單一畫面檔直接視為 target boundary。
|
|
11
|
+
|
|
12
|
+
本 workflow 的術語必須與 repo shared terminology contract 對齊;若 repo 提供 `.github/skills/source-code-to-spec-tools/references/terminology-contract.md`,以該檔為準。`documentation target` 是可被獨立啟動或使用者指定的文件目標;`keyword` 不是 target queue;`Function` 不泛指 method/helper;document section 不是 `source_type`;未限定的 `source` 應改寫成 `source code`、`source evidence`、`authoritative source`、`source extract` 或 `source_type`。
|
|
13
|
+
|
|
14
|
+
## Core Rule
|
|
15
|
+
|
|
16
|
+
優先採用以下 evidence 順序:
|
|
17
|
+
|
|
18
|
+
1. Authoritative registries:menu tables、navigation registries、permission mappings、route registries、scheduler registries、ERP metadata、DB job definitions、repo-owned hardcoded menu/navigation/command definitions、client-side navigation config、external menu/config files。
|
|
19
|
+
2. Runtime entrypoints:controllers、API routes、service endpoints、message consumers、CLI commands、workflow definitions、mobile/desktop navigation nodes、public library exports、data pipeline definitions。
|
|
20
|
+
3. Handler call chains:controller/action -> service -> DAO/repository -> SQL/table/file/queue。
|
|
21
|
+
4. Implementation files:JSP/JS/TS/Java/C#/SQL/report/form files 僅作為 supporting evidence,預設不視為 standalone documentation targets。
|
|
22
|
+
|
|
23
|
+
如果某個看似獨立的 screen 或 file 沒有對應的獨立 menu、route、permission、job、API、command 或 navigation entry,應將它分類為 sub-action、helper、partial、include、dialog、report asset,或 unresolved candidate。
|
|
24
|
+
|
|
25
|
+
## Authority Disambiguation
|
|
26
|
+
|
|
27
|
+
- 將 bootstrap、control-plane 與 row authority 分開處理。若 startup、monitor、launcher、dispatcher、wrapper、deployment switch 或 polling loop 只是啟用、重啟、輪詢、委派或包裝另一個 runtime unit,它最多只能作為 activation clue 或 control evidence;必須再追一跳到真正列舉、註冊、排程、載入或組裝 target rows 的 registry / metadata source。
|
|
28
|
+
- 若同一 activation surface 同時出現 deployment config、persisted metadata、repo-owned hardcoded registry、generated export、external metadata 或其他 candidate authorities,請分 scope 記錄。只有直接產生或載入 target rows 的來源可標為最終 row authority;其餘來源應保留為 enablement/control evidence、獨立 acquisition scope,或 coverage gap。
|
|
29
|
+
- 在 handoff 定稿前,對每個 registry-driven scope 至少做一個便宜的反證檢查:確認 candidate source 是否真的被 runtime 直接讀取、實例化、註冊或 build;若發現還有更直接的 registry read / metadata load path,應改由後者擔任 authoritative source。
|
|
30
|
+
|
|
31
|
+
## Workflow
|
|
32
|
+
|
|
33
|
+
### 1. Fingerprint The Repo
|
|
34
|
+
|
|
35
|
+
在列舉 documentation targets 前,先辨識 runtime types:
|
|
36
|
+
|
|
37
|
+
- Languages and frameworks。
|
|
38
|
+
- Runtime types:web、mobile、desktop、batch/job、DB-heavy、ERP、integration、reporting、command、workflow、library/API、data pipeline。
|
|
39
|
+
- 可能的 entrypoint mechanisms:menu source、router、controller、scheduler、DB job、target registry、API、queue、file watcher、command line、workflow engine、package export、DAG/pipeline registry。
|
|
40
|
+
- 能揭露 runtime shape 的 build/deploy/config files。
|
|
41
|
+
|
|
42
|
+
當 repo 屬於 mixed-stack,或需要判斷該從哪裡搜尋 authoritative entry sources 時,閱讀 `references/entrypoint-source-patterns.md`。
|
|
43
|
+
|
|
44
|
+
### 2. Discover Authoritative Entry Sources
|
|
45
|
+
|
|
46
|
+
在大範圍列舉檔案之前,先搜尋有 source backing 的 activation surfaces:
|
|
47
|
+
|
|
48
|
+
- 來自 config、SQL seed、migration、XML/YAML/JSON、code constants、hardcoded menu/navigation/command code、client-side router/navigation config、external menu/config file、ERP metadata 或 DB access code 的 menu/navigation/permission metadata。
|
|
49
|
+
- Web routes、frontend routers、server controllers、JSP/Struts/Spring/.NET route mappings。
|
|
50
|
+
- Mobile navigation graphs、activities/screens、deep links、tab definitions。
|
|
51
|
+
- Desktop menus、command bindings、toolbar actions、form/window registries。
|
|
52
|
+
- Scheduler/job definitions、batch launchers、DBMS scheduler、SQL Agent、Quartz、Hangfire、cron、Windows services。
|
|
53
|
+
- API/service/message/file/CLI/workflow/library/data-pipeline entrypoints。
|
|
54
|
+
|
|
55
|
+
如果 target、menu 或 navigation list 看起來只存在於 production DB data,請記錄推定來源,並把缺少的 DB seed/data 標記為 unresolved coverage item。
|
|
56
|
+
|
|
57
|
+
如果 menu、navigation、command 或 job list 是寫死在 repo code/config 中,且該 code/config 是 runtime 實際使用的 activation source,請把它視為 repo-owned authoritative source,逐列列出 hardcoded targets、labels、handlers 與 source lines。不要只把 hardcoded targets 當作 supporting evidence。
|
|
58
|
+
|
|
59
|
+
如果 menu 由 client-side router、SPA navigation config、mobile navigation graph、desktop command config、external JSON/YAML/CSV/XML、CMS export、deployment-mounted file 或 vendor/platform metadata 產生,請把該來源視為該 scope 的 candidate authority。若檔案或 export 在 repo 中可讀,逐列解析;若只知道來源名稱但拿不到 rows,列入 handoff 的 acquisition/parse request,不要退回用 page files 猜測。
|
|
60
|
+
|
|
61
|
+
### 2.1 Produce Authoritative Target Source Handoff
|
|
62
|
+
|
|
63
|
+
在 output 中加入 `Authoritative Target Source Handoff` section,明確交接給後續 `docs-target-queue-from-catalog`:
|
|
64
|
+
|
|
65
|
+
- `target_scope`: 這個來源負責哪些 documentation targets。
|
|
66
|
+
- `source_kind`: `DB metadata`、`repo-owned config`、`repo-owned hardcoded code`、`client-side navigation`、`external file`、`route registry`、`scheduler registry`、`external metadata` 等。
|
|
67
|
+
- `authoritative_source`: table、file、config、registry、API、export 名稱。
|
|
68
|
+
- `final_row_authority`: 是否可作為該 scope 的最終 target rows;若仍缺 rows,說明需要 acquisition。
|
|
69
|
+
- `required_fields_or_handles`: 第二階段要取得或使用的最小欄位/handle。
|
|
70
|
+
- `target_queue_action`: 第二階段應 `query/export`、`parse_file`、`direct_rows` 或 `coverage_gap`。
|
|
71
|
+
|
|
72
|
+
DB-backed source、client-side source、external file source 與 hardcoded source 可以同時存在,但必須分 scope。不要把 DB table 說成整個系統唯一來源,如果 repo、client 或 external file 另有 menu/navigation entries;也不要因 DB menu 缺失而忽略已確認的 non-DB entries。
|
|
73
|
+
|
|
74
|
+
authority 判定若有疑義,回到上面的 `Authority Disambiguation` 規則處理;不要在 handoff table 內同時把 control-plane source 與 final row authority 寫成同一列。
|
|
75
|
+
|
|
76
|
+
### 3. Build An Entrypoint Inventory
|
|
77
|
+
|
|
78
|
+
每個可由 source 驗證的 entrypoint 建立一列,內容包含:
|
|
79
|
+
|
|
80
|
+
- Stable id。
|
|
81
|
+
- Entry type:menu、route、API、job、DB job、report、screen、command、workflow、queue consumer、file import/export、ERP program/transaction、mobile screen、desktop action、library API、data pipeline。
|
|
82
|
+
- Display label 或 technical name。
|
|
83
|
+
- Source file/table/config 與可精準搜尋的 handle。
|
|
84
|
+
- Target handler。
|
|
85
|
+
- 若存在則記錄 access control、permission code 或 runtime metadata 明確提供的 metadata code。
|
|
86
|
+
- Unresolved notes。
|
|
87
|
+
|
|
88
|
+
### 4. Trace Implementation Scope
|
|
89
|
+
|
|
90
|
+
對每個 entrypoint,只 trace 到足以辨識 feature boundary 的深度:
|
|
91
|
+
|
|
92
|
+
- UI/screen/view files。
|
|
93
|
+
- Controller/action/handler。
|
|
94
|
+
- Service/domain logic。
|
|
95
|
+
- DAO/repository/stored procedure/package。
|
|
96
|
+
- Tables/views/files/queues/external systems。
|
|
97
|
+
- Reports/templates/download/upload resources。
|
|
98
|
+
|
|
99
|
+
保留可直接回查 source 的精確 handle。如果 call chain 分叉進入 shared framework code,請在 shared boundary 停止並加註說明。
|
|
100
|
+
|
|
101
|
+
### 5. Cluster Into Documentation Targets
|
|
102
|
+
|
|
103
|
+
當多個 files/actions 共享明確證據時,將它們歸納到同一個 documentation target:
|
|
104
|
+
|
|
105
|
+
- 相同的 menu/navigation/permission code,或 runtime metadata 明確提供的 metadata code。
|
|
106
|
+
- 相同的 route prefix 或 navigation path。
|
|
107
|
+
- 相同的 controller/handler family。
|
|
108
|
+
- 相同的主要 business noun 與 data resource。
|
|
109
|
+
- 只能透過同一個 parent entry 進入的 CRUD/detail/popup/export/import actions。
|
|
110
|
+
|
|
111
|
+
若存在獨立的 activation evidence,則應拆分為不同 documentation targets:
|
|
112
|
+
|
|
113
|
+
- 獨立的 menu item 或 ERP program/transaction metadata。
|
|
114
|
+
- 獨立的 permission code,或 runtime metadata 明確提供的 metadata code。
|
|
115
|
+
- 獨立的 scheduler/job/API/command/workflow/queue entry。
|
|
116
|
+
- 獨立的 mobile/desktop navigation node、public library export 或 data pipeline definition。
|
|
117
|
+
- 獨立的 business outcome 或主要 data resource。
|
|
118
|
+
- 不需經過 parent、可由 user/system 直接進入。
|
|
119
|
+
|
|
120
|
+
### 6. Classify Target Vs Sub-Action
|
|
121
|
+
|
|
122
|
+
如果某項能力擁有自己的 entry source、可被直接觸達,或具有獨立 authorization boundary,就歸類為 top-level documentation target。
|
|
123
|
+
|
|
124
|
+
如果它只是 parent target 底下的子動作,且缺乏獨立 entry evidence,例如 `create`、`edit`、`delete`、`detail`、`lookup`、`popup`、`partial`、`include`、`print`、`export` 或 `upload` screens,則歸類為 sub-action。
|
|
125
|
+
|
|
126
|
+
避免把每個 JSP、Razor page、SQL file、stored procedure 或 CRUD method 都提升成 top-level target。
|
|
127
|
+
|
|
128
|
+
### 7. Produce Navigation-First Outputs
|
|
129
|
+
|
|
130
|
+
優先輸出以下結果,並依使用者需求調整粒度。下列 filename 只是常見 convention,不是硬性規定;如果 repo 已有自己的 docs 命名或 folder 慣例,請沿用既有慣例。當目標是交接給 `docs-target-queue-from-catalog` 或產生 `docs-target-queue.md` 時,不要強制先產生 feature catalog。
|
|
131
|
+
|
|
132
|
+
- `Compact handoff catalog`: 當目標是交接給 `docs-target-queue-from-catalog` 或產生 `docs/docs-target-queue.md`,預設只輸出精簡 source handoff、direct rows 與 coverage review;不要輸出完整 per-target deep dive,除非使用者明確要求 deep mode。
|
|
133
|
+
- `<feature-catalog-file>`:grouped business capabilities with entrypoints, actions, source evidence, unresolved items;如果 repo 採用 numbered feature-catalog convention,請使用 repo 現有或使用者指定的 catalog filename。
|
|
134
|
+
- `<entrypoint-map-file>`:raw menu/route/API/job/screen/command entries mapped to handlers and documentation targets;如果 repo 採用 numbered source-map convention,請使用 repo 現有或使用者指定的 entrypoint-map filename。
|
|
135
|
+
- `<data-resource-map-file>`:table/procedure/file/queue/resource backtracking to documentation targets;如果 repo 採用 numbered source-map convention,請使用 repo 現有或使用者指定的 data-resource-map filename。
|
|
136
|
+
- `Authoritative Target Source Handoff`: source-of-truth map for `docs-target-queue-from-catalog`.
|
|
137
|
+
- `<target-handle-index-file>`:exact searchable menu/API/job/report/command handles。
|
|
138
|
+
- `<scheduler-target-index-file>`:exact searchable batch/job/scheduler handles。
|
|
139
|
+
- Coverage review:缺漏或 source evidence 不足的 entry sources、疑似僅存在於 DB 的 menu data、尚未 trace 的 handlers、orphan files。
|
|
140
|
+
|
|
141
|
+
當要產出可重用的 files 或 tables 時,閱讀 `references/output-templates.md`。
|
|
142
|
+
|
|
143
|
+
Compact handoff catalog 的預設 sections:
|
|
144
|
+
|
|
145
|
+
- `Repo Fingerprint`: 只保留影響 authoritative source 搜尋的最小 facts。
|
|
146
|
+
- `Authoritative Target Source Handoff`: 每個 target scope 一列,直接指定第二階段 `query/export`、`parse_file`、`direct_rows` 或 `coverage_gap`。
|
|
147
|
+
- `Direct Target Rows` 或 `Hardcoded Target Rows`: 只列可直接轉成 `docs-target-queue.md` 的 repo-owned rows。
|
|
148
|
+
- `Coverage Review`: 集中列出缺少 metadata、弱證據 candidates、orphan handlers,以及不能進入主表的 source gaps。
|
|
149
|
+
|
|
150
|
+
Compact handoff catalog 不應輸出完整 call chain、完整 data-resource map、逐 target `Unresolved: None`,或只根據 summary/candidate 展開的 target rows。
|
|
151
|
+
|
|
152
|
+
當要在 `docs/**/*.md` 下寫入 compact handoff catalog 時,加入精簡 `## Obsidian Links`;links 只可使用已確認存在、或本次同時建立的 notes。沒有可靠 links 時可省略整個區塊;不要加入 placeholder、sample hub、YAML frontmatter、tags 或其他非 contract metadata。
|
|
153
|
+
|
|
154
|
+
## Source Gap Handling Rules
|
|
155
|
+
|
|
156
|
+
不要輸出額外判斷分類。可由 entry source、handler 或 runtime metadata 回查的 target 才放入 documentation targets;其他命名推測、間接引用、不完整 trace 或 repo 外來源缺口,集中放在 `Coverage Review`,並只保留 gap、affected scope 與 recommended next search。
|
|
157
|
+
|
|
158
|
+
## Search Guidance
|
|
159
|
+
|
|
160
|
+
可使用 repo shared source lookup CLI 作為 source evidence lookup 輔助,再依結果補充人工閱讀。不要只靠散落的手動 `rg` scrollback 形成 catalog evidence,也不要呼叫其他 skill 私有 `scripts/` 目錄。
|
|
161
|
+
|
|
162
|
+
當需要重複查找 source evidence,且 repo 提供 `.github/skills/source-code-to-spec-tools/scripts/source_lookup.py` 時,可使用以下命令:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
python .github/skills/source-code-to-spec-tools/scripts/source_lookup.py --root <source-root> --handle "<entrypoint-pattern>" --ignore-case --output json
|
|
166
|
+
python .github/skills/source-code-to-spec-tools/scripts/source_lookup.py --root <source-root> --handle "<registry-keyword>" --include "**/*.xml" --include "**/*.json" --include "**/*.yaml" --context 2
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
若使用 `source_lookup.py`,其輸出必須保留到工作摘要或 evidence note 中,至少包含 `path`、`line`、`handles` 與 matched text。若需要 structured config parser 或 DB/API acquisition,CLI lookup 只作為定位輔助,不可取代真正的 row authority。
|
|
170
|
+
|
|
171
|
+
先廣泛盤點 repo 檔案,再搜尋 entrypoint patterns。把 registries 中的名稱往回搜尋到 code,也把 handler 名稱往前追到 views、services、data access。若可行,優先使用 structured config 或 parser-aware 的讀法;但在 discovery 階段,簡單搜尋也可接受。
|
|
172
|
+
|
|
173
|
+
可使用的通用搜尋詞包含:
|
|
174
|
+
|
|
175
|
+
- `menu`, `function`, `permission`, `role`, `auth`, `module`, `program`, `screen`, `form`
|
|
176
|
+
- `route`, `controller`, `request`, `action`, `endpoint`, `api`
|
|
177
|
+
- `job`, `schedule`, `cron`, `batch`, `worker`, `queue`, `consumer`
|
|
178
|
+
- `report`, `export`, `import`, `upload`, `download`
|
|
179
|
+
- `procedure`, `package`, `dbms_scheduler`, `sqlagent`, `trigger`
|
|
180
|
+
|
|
181
|
+
## Output Standard
|
|
182
|
+
|
|
183
|
+
每個 confirmed documentation target 都必須附上 source evidence。每一列或每個區段都應回答:
|
|
184
|
+
|
|
185
|
+
- 由什麼機制啟動?
|
|
186
|
+
- 啟動點定義在哪裡?
|
|
187
|
+
- 會執行哪個 handler?
|
|
188
|
+
- 它代表哪一種 user/system action?
|
|
189
|
+
- 哪個 authoritative source 應作為後續 `docs-target-queue.md` 的 row source?
|
|
190
|
+
- 哪些 files/resources 只是 implementation details?
|
|
191
|
+
- 觸及哪些 data resources?
|
|
192
|
+
- 目前還有哪些 source evidence gap 或 unresolved items?
|
|
193
|
+
|
|
194
|
+
當使用者要的是 target catalog,不要只產出 docs-first 或 architecture-only 的摘要。結果應以便於 lookup 與 source navigation 為優先。
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Documentation Target Queue Conversion
|
|
2
|
+
|
|
3
|
+
當使用者明確要求同一輪將 source-code documentation target catalog 轉成 repo root `docs/docs-target-queue.md`,或下游 `docs-target-queue-from-catalog` 需要讀取 catalog handoff 時,才使用這份參考。一般 catalog discovery 不需要載入本文件。
|
|
4
|
+
|
|
5
|
+
## Shared Queue Contract
|
|
6
|
+
|
|
7
|
+
Queue 欄位順序、supporting table 欄位、status enum、`doc_profile` 規則、`source_type` registry、prefix 與 `document_path` default pattern 以 `.github/skills/source-code-to-spec-tools/references/target-queue-schema-contract.md` 為準;converter scripts 必須 import `.github/skills/source-code-to-spec-tools/scripts/queue_contract.py`。
|
|
8
|
+
|
|
9
|
+
本文件只說明 catalog-to-queue conversion 的判斷流程,不維護第二份欄位、profile 或 `source_type` 清單。
|
|
10
|
+
|
|
11
|
+
## Conversion Pipeline
|
|
12
|
+
|
|
13
|
+
1. 建立或讀取 entrypoint inventory。
|
|
14
|
+
2. 將 entrypoints 與 implementation files 歸併成真正的 documentation targets。
|
|
15
|
+
3. 過濾只屬於 implementation 的 artifacts。
|
|
16
|
+
4. 指派 `source_type` 與穩定的 IDs。
|
|
17
|
+
5. 決定 `group`、`name`、`entrypoint`、`keyword`、`document_path` 與 `doc_profile`。
|
|
18
|
+
6. 初始化 queue 狀態欄。
|
|
19
|
+
7. 輸出精簡表格。
|
|
20
|
+
8. 將排除的 candidates 與尚未解決的 source gaps 放到 coverage review,不要放進主表。
|
|
21
|
+
|
|
22
|
+
## Row Eligibility
|
|
23
|
+
|
|
24
|
+
當項目是具有獨立 activation evidence 的 documentation target 時,納入一列:
|
|
25
|
+
|
|
26
|
+
- 使用者可見的 menu/navigation target 或 business capability。
|
|
27
|
+
- 外部系統或 frontend 會直接使用的 API endpoint 或 service contract。
|
|
28
|
+
- Scheduled job、DB job、worker、batch job 或 background processor。
|
|
29
|
+
- 可由 menu 存取、可排程、可匯出,或具有獨立權限控管的 report。
|
|
30
|
+
- File import/export process、file watcher、queue consumer、webhook 或 external integration。
|
|
31
|
+
- ERP program/transaction、concurrent program、responsibility/menu item、form、report,或平台明確定義的 target metadata。
|
|
32
|
+
- 可獨立執行的 CLI/operator command、script command 或 console command。
|
|
33
|
+
- Workflow、BPMN/process definition、approval flow、state-machine transition set 或 orchestrated business process。
|
|
34
|
+
- Mobile screen、tab、deep link、activity/fragment destination 或 mobile navigation node。
|
|
35
|
+
- Desktop menu/toolbar action、shortcut command、form/window action 或 desktop command binding。
|
|
36
|
+
- Public library/package API、SDK entrypoint 或 exported module contract。
|
|
37
|
+
- Data pipeline、DAG、ETL/ELT flow、stream processor 或 materialized data product refresh。
|
|
38
|
+
|
|
39
|
+
預設排除:
|
|
40
|
+
|
|
41
|
+
- 只能透過 parent target 進入的 CRUD child screens,例如 create/edit/delete/detail。
|
|
42
|
+
- Popup、lookup、modal、partial、include、tab、wizard step、layout 或 shared component。
|
|
43
|
+
- 沒有獨立 activation 的 DAO/repository/service/helper/utility classes。
|
|
44
|
+
- 只支援 parent target 的 SQL files、stored procedures、packages、triggers 與 views。
|
|
45
|
+
- 若真正的 entry source 是 generator 或 metadata source,則排除 generated files。
|
|
46
|
+
- 只有命名推測、source evidence 不足的 candidates。
|
|
47
|
+
|
|
48
|
+
只有當 source evidence 顯示它具有自己的 menu、permission code、route、job registration、API contract、scheduler、command、workflow definition、mobile/desktop navigation entry、library export、pipeline definition、queue/file entry、ERP program/transaction metadata 或平台明確定義的 target metadata 時,才把原本排除的項目提升為獨立列。
|
|
49
|
+
|
|
50
|
+
## Source Type And Prefix Rules
|
|
51
|
+
|
|
52
|
+
請使用最符合 activation surface 的具體 source type。一旦檔案已存在,prefix 就要保持穩定。
|
|
53
|
+
|
|
54
|
+
允許的 `source_type`、prefix、default `doc_profile` 與 `document_path` pattern 由 shared schema contract 的 `Source Type Registry` 定義。如果系統需要其他 source type,代表要透過 registration extension 支援新的 activation surface;先在 shared contract 中定義唯一的大寫 prefix、default `doc_profile` 與 path pattern,再新增資料列。converter 對未知 `source_type` 不會 automatic 接受,除非本次 run 明確傳入 `--prefix source_type=PREFIX`。不要因程式語言不同而新增 type;`source_type` 描述 activation surface,不描述 Java/C#/Python/JavaScript 等 implementation language。
|
|
55
|
+
|
|
56
|
+
## ID And Original ID Rules
|
|
57
|
+
|
|
58
|
+
- `original_id` 是同一個 `source_type` 內的流水號。
|
|
59
|
+
- `id` 格式為 `<prefix><original_id>`,例如 `F1`、`J1`、`A1`、`FI1`、`C1`、`W1`、`M1`、`D1`、`L1`、`DP1`。
|
|
60
|
+
- 如果 repo root 的 docs/docs-target-queue.md 已存在,必須保留所有既有的 IDs 與 original IDs。
|
|
61
|
+
- 新增列時,使用該 `source_type` 下一個可用編號。
|
|
62
|
+
- 排序、重新分組、合併 evidence 或修改名稱時,都不要重新編號。
|
|
63
|
+
- 若發現重複 target,保留較舊的 ID,並把較好的 evidence 合併到該列。
|
|
64
|
+
|
|
65
|
+
## Field Mapping Rules
|
|
66
|
+
|
|
67
|
+
### `group`
|
|
68
|
+
|
|
69
|
+
優先順序如下:
|
|
70
|
+
|
|
71
|
+
1. Menu group、module、responsibility、ERP application 或 navigation section。
|
|
72
|
+
2. 從 route prefix、package/module name、bounded context 或 primary data resource 推得的 business domain。
|
|
73
|
+
3. 由 scheduler/config/folder 推得的 job/report/integration category。
|
|
74
|
+
4. 只有在完全沒有 source-backed grouping 時才使用 `Unclassified`。
|
|
75
|
+
|
|
76
|
+
### `name`
|
|
77
|
+
|
|
78
|
+
優先使用 user 或 operator 看得到的名稱:
|
|
79
|
+
|
|
80
|
+
1. Menu label、ERP program/transaction name、平台 metadata name、report title、job display name、API operation name。
|
|
81
|
+
2. 將 permission/program/metadata code 轉成可讀文字。
|
|
82
|
+
3. 將 route/handler/class/procedure name 轉成可讀文字。
|
|
83
|
+
|
|
84
|
+
如果已有 parent target name,不要用 helper class 或 child screen 的檔名當作 `name`。
|
|
85
|
+
|
|
86
|
+
### `entrypoint`
|
|
87
|
+
|
|
88
|
+
只儲存主要 activation handle。請擇一使用精簡值:
|
|
89
|
+
|
|
90
|
+
- Menu target file 或 route。
|
|
91
|
+
- API method 與 path,例如 `POST /orders`。
|
|
92
|
+
- Job class、scheduler key、command 或 DB job name。
|
|
93
|
+
- ERP program/transaction/form id。
|
|
94
|
+
- File watcher/import/export handler。
|
|
95
|
+
- Workflow/process definition id、mobile/desktop navigation id、public library export name 或 data pipeline DAG id。
|
|
96
|
+
|
|
97
|
+
不要把完整 call chain 放進 `entrypoint`。call-chain evidence 應保留在 coverage review 或詳細的 feature catalog。
|
|
98
|
+
|
|
99
|
+
### `document_path`
|
|
100
|
+
|
|
101
|
+
請使用 repository-relative paths。Default pattern 由 shared schema contract 的 `Source Type Registry` 定義;path segments 要符合 repo 既有風格,避免使用機器專屬的 absolute paths。
|
|
102
|
+
|
|
103
|
+
### `keyword`
|
|
104
|
+
|
|
105
|
+
選擇最容易從 source 搜到、也最能定位 target 的 keyword:
|
|
106
|
+
|
|
107
|
+
1. 唯一且在 source 中可見的 permission/program/metadata code。
|
|
108
|
+
2. 出現在 source 或 seed data 中的 menu/report/job/API label。
|
|
109
|
+
3. Route path、endpoint path、command name、job id、scheduler key、workflow id、mobile/desktop navigation id、exported API name、pipeline id。
|
|
110
|
+
4. Main handler class/method/procedure 或 primary screen file。
|
|
111
|
+
|
|
112
|
+
每列只用一個精簡 keyword。若有多個重要 handles,`keyword` 請挑選最可靠的搜尋入口,其餘資訊放到 detailed catalog 或 evidence notes。
|
|
113
|
+
|
|
114
|
+
### `doc_profile`
|
|
115
|
+
|
|
116
|
+
`doc_profile` 決定後段 target SPEC 的文件深度;允許值與 default profile rules 由 shared schema contract 定義。若來源沒有提供 profile,依 shared default 補值;不要把所有 row 都預設成 `full`。
|
|
117
|
+
|
|
118
|
+
## Duplicate And Split Rules
|
|
119
|
+
|
|
120
|
+
當多筆 entries 其實代表同一個 documentation target 時,應合併為同一列:
|
|
121
|
+
|
|
122
|
+
- 相同的 menu/navigation/permission code,或 runtime metadata 明確提供的 metadata code。
|
|
123
|
+
- 相同的 parent menu 與相同的 primary business object。
|
|
124
|
+
- 同一個 parent 底下的 CRUD/list/detail/edit/export actions。
|
|
125
|
+
- 同一 target 的多個 aliases 或 localized labels。
|
|
126
|
+
|
|
127
|
+
當 entries 具有獨立的 documentation scope 時,應拆成多列:
|
|
128
|
+
|
|
129
|
+
- 不同的 menu 或 permission code。
|
|
130
|
+
- 不同的 scheduler/API/command/ERP metadata。
|
|
131
|
+
- 不同的 report identity。
|
|
132
|
+
- 不同的 external contract。
|
|
133
|
+
- 不同的 business owner 或 lifecycle。
|
|
134
|
+
|
|
135
|
+
如果無法確定,先保留一列已確認的 parent row,並把不確定的 child 列為 excluded 或 unresolved candidate。
|
|
136
|
+
|
|
137
|
+
## Coverage Review
|
|
138
|
+
|
|
139
|
+
在表格後方,必要時補上一段簡短的 coverage review:
|
|
140
|
+
|
|
141
|
+
| item | reason_not_in_table | evidence | recommended_next_step |
|
|
142
|
+
| ---- | ------------------- | -------- | --------------------- |
|
|
143
|
+
|
|
144
|
+
適用情況:
|
|
145
|
+
|
|
146
|
+
- repo 中不存在的 DB-owned menu/navigation metadata。
|
|
147
|
+
- 只靠檔名推測、source evidence 不足的 candidates。
|
|
148
|
+
- 沒有 activation evidence 的 orphan handlers。
|
|
149
|
+
- 可能可獨立存在,但缺少 scheduler/API/menu evidence 的 shared SQL/procedures。
|
|
150
|
+
- 需要業務確認的重複或模糊名稱。
|
|
151
|
+
|
|
152
|
+
coverage review 是診斷資訊,不屬於 `docs/docs-target-queue.md` 的 main target queue table;必要時放在後段 `## Coverage Review`。
|
|
153
|
+
|
|
154
|
+
## Minimal Output Contract
|
|
155
|
+
|
|
156
|
+
當使用者只要求 docs/docs-target-queue.md 時,輸出內容應為:
|
|
157
|
+
|
|
158
|
+
1. 完全符合 shared schema contract 的 main target queue table。
|
|
159
|
+
2. 依 `source_type` 統計的簡短說明。
|
|
160
|
+
3. 針對 excluded 或 unresolved candidates 的簡短 coverage review。
|
|
161
|
+
|
|
162
|
+
除非使用者另外要求,否則不要加入 repo fingerprint、完整 call chains、data-resource maps 或詳細 feature sections。
|
|
163
|
+
|
|
164
|
+
預設輸出檔案固定為 repo root 的 docs/docs-target-queue.md;若 docs 目錄不存在,先建立目錄後再寫入。
|