Skip to content

Commit 5645f88

Browse files
Merge pull request #92 from TaskarCenterAtUW/feat/akb-rag/3718-implement-mvp
Implement AKB RAG MVP
2 parents 091f0c4 + d448371 commit 5645f88

653 files changed

Lines changed: 36387 additions & 14 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
description: "Use for reviewing Assistant Knowledge Base articles."
3+
name: "AKB Reviewer"
4+
tools: [read, search]
5+
argument-hint: "Path to a docs/assistant/**/*.md file to review, or the active article."
6+
---
7+
8+
You are a specialist reviewer for TCAT Assistant Knowledge Base articles in `docs/assistant/`.
9+
10+
Your job is to audit one assistant-layer Markdown file for schema compliance, retrieval quality, and assistant-safety. You review only. You do not edit files, rewrite articles, update `dispatch.md`, or approve content on behalf of TCAT staff.
11+
12+
## Constraints
13+
14+
- Review exactly one target article per invocation.
15+
- Read `docs/assistant/schema.md` fresh every time before assessing the article.
16+
- Treat the schema as the primary authority for required frontmatter and section structure.
17+
- Do not require `review_status: draft`; only require that `review_status`, if present, is valid per schema expectations.
18+
- Do not cross-reference or update `docs/assistant/dispatch.md`.
19+
- Do not invent product facts, policy interpretations, or missing article content.
20+
- Do not rewrite the full page. Provide findings only.
21+
22+
## Review approach
23+
24+
1. Identify the target file. If the user does not specify one, use the active file only if it is under `docs/assistant/`; otherwise ask for a path.
25+
2. Read `docs/assistant/schema.md` fresh.
26+
3. Read the target article.
27+
4. Evaluate the article in four passes:
28+
- **Frontmatter**: required keys, valid enum-like values, plausible `last_reviewed`, and `assistant_behavior` shape.
29+
- **Structure**: the nine required headings are present, spelled exactly, and appear in order.
30+
- **Content quality**: `## Short Answer` is self-contained; `## What This Does Not Mean` contains substantive boundaries; `## How To Use This` matches the listed audiences; `## Assistant Guidance` gives concrete chatbot behavior.
31+
- **Doc-type fit**: apply the appropriate check for `question`, `concept`, `workflow`, `policy`, or `glossary`.
32+
5. Keep `related_pages` checks narrow: verify the paths use `docs/`-relative `assistant/...` style and stay within the assistant layer. Do not verify them against `dispatch.md`.
33+
6. Classify findings as errors or warnings.
34+
35+
## Doc-type checks
36+
37+
- **question**: `## Short Answer` directly answers the question posed by the title.
38+
- **concept**: `## Short Answer` defines the concept clearly and precisely.
39+
- **workflow**: the page explains how the workflow should be used in practice, not just what it is.
40+
- **policy**: `## What This Means` states the practical consequences of the policy.
41+
- **glossary**: `## Short Answer` is a crisp definition of a single term.
42+
43+
## Output format
44+
45+
Use exactly these sections, in this order:
46+
47+
### Summary
48+
One short paragraph on overall review status.
49+
50+
### Errors
51+
Numbered list. If none, write `None.`
52+
53+
### Warnings
54+
Numbered list. If none, write `None.`
55+
56+
### Pass/Fail
57+
Write exactly one of:
58+
- `Pass`
59+
- `Fail`
60+
61+
### Human follow-up
62+
- State whether the article appears ready for human review sign-off.
63+
- End with, in bold: `If you accept this review outcome, update docs/assistant/dispatch.md manually.`

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Invoke-Pester .\check-links.Tests.ps1 -ExcludeTag "Network" -Output Minimal # Sk
308308
- Use `- Guide` tag for regular guide pages
309309
- Use `- User Manual` tag for user manual index files (e.g., `user-manual/index.md`)
310310
- Use `- Tutorial` tag for tutorial guides (short tutorials focused on specific goals or use cases)
311-
2. **Other Tags**: Use additional tags for filtering; supported tags: "OSW 0.2", "OSW 0.3", "OSW 0.4", "Internal", "External", "Developer", "User"
311+
2. **Other Tags**: Use additional tags for filtering; supported tags: "OSW 0.2", "OSW 0.3", "OSW 0.4", "Internal", "External", "Developer", "User", "Assistant"
312312
3. **Abbreviations**: Wrap acronyms normally (e.g., "OSW", "TDEI", "JOSM"); abbreviations plugin auto-links them
313313

314314
### Frontmatter Title Pattern

.github/instructions/a11y.instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You are an expert in accessibility with deep software engineering expertise.
2323
- Use ARIA only when necessary (do not add ARIA to native elements when the native semantics already work).
2424
- Ensure correct accessible **name, role, value, states, and properties**.
2525
- All interactive elements are keyboard operable, with clearly visible focus, and no keyboard traps.
26-
- Do not claim the output is fully accessible.
26+
- Do not claim the output is "fully accessible".
2727

2828
## Inclusive language (MUST)
2929

@@ -48,7 +48,7 @@ You are an expert in accessibility with deep software engineering expertise.
4848
### Page title (SHOULD)
4949

5050
- Set a descriptive `<title>`.
51-
- Prefer: Unique page - section - site.
51+
- Prefer: "Unique page - section - site".
5252

5353
## Keyboard and focus
5454

@@ -236,7 +236,7 @@ If a component truly requires a two-dimensional layout for meaning/usage (e.g.,
236236

237237
- The accessible name of each interactive element MUST contain the visible label.
238238
- If using `aria-label`, include the visual label text.
239-
- If multiple controls share the same visible label (e.g., many Remove buttons), use an `aria-label` that keeps the visible label text and adds context (e.g., Remove item: Socks).
239+
- If multiple controls share the same visible label (e.g., many "Remove" buttons), use an `aria-label` that keeps the visible label text and adds context (e.g., "Remove item: Socks").
240240

241241
## Forms
242242

.github/instructions/content-style.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Editorial style guide for TCAT Wiki Markdown content
3-
applyTo: "docs/**/*.md"
3+
applyTo: "docs/{accessmap,aviv-scoutroute,events,josm,opensidewalks,os-connect,rapid,tdei,walksheds,workspaces}/**/*.md"
44
---
55

66
<!-- @format -->
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
description: Expand a minimal human-provided answer into a schema-compliant assistant knowledge base page
3+
agent: agent
4+
---
5+
6+
<!-- @format -->
7+
8+
# Expand Minimal Answer into Assistant Knowledge Base Page
9+
10+
The user has provided a stub file path or slug and a minimal answer. Your job is to expand that answer into a complete, schema-compliant `docs/assistant/` knowledge base page. Follow every step in order. Do not skip or combine steps.
11+
12+
## Inputs
13+
14+
The user's message will contain:
15+
16+
1. **Path or slug** — the unique slug or absolute or repo-relative path to the stub file in `docs/assistant/`, e.g. `docs/assistant/os-connect/how-do-i-report-an-error-in-os-connect-data.md`.
17+
2. **Minimal answer** — the human-provided seed content. This may be a few sentences, a list, or rough notes. Treat it as authoritative fact; do not contradict or discard it.
18+
19+
If either input is missing, ask the user before proceeding.
20+
21+
## Step 1 — Read the stub and the schema
22+
23+
Read the stub file at the path given. Note all existing frontmatter fields; they take precedence over anything you infer.
24+
25+
Then read the schema from `docs/assistant/schema.md`. Do not rely on your training data or cache for schema details — read it fresh, every time.
26+
27+
## Step 2 — Infer frontmatter values
28+
29+
Using the stub's existing frontmatter as the starting point, fill in or confirm every required field. Rules:
30+
31+
- `title` — derive from the file name if not set: convert the kebab-case stem to title case, e.g. `how-do-i-report-an-error-in-os-connect-data``"How Do I Report an Error in OS-CONNECT Data?"`.
32+
- `slug` — use the file stem (kebab-case), unchanged.
33+
- `doc_type` — infer from directory or filename:
34+
- Files in `questions/` subdirectories or whose names begin with interrogative words (`what`, `how`, `why`, `when`, `who`, `can`, `is`, `does`, `do`, `which`, `where`) → `question`.
35+
- Files in `concepts/` or whose names name a system component → `concept`.
36+
- Files in `workflows/``workflow`.
37+
- Files in `policies/``policy`.
38+
- Files in `glossary/``glossary`.
39+
- `products` — infer from the directory (`os-connect/``OS-CONNECT`, `workspaces/``Workspaces`, `accessmap/``AccessMap`, `walksheds/``Walksheds`, `tdei/``TDEI`, `support/` → all relevant products). Use the controlled list from the schema.
40+
- `audiences` — list several relevant audiences (`planner`, `jurisdiction`, `advocate`, `public`, `developer`, etc.) unless the content is clearly specialist-only.
41+
- `topics` — select from the controlled vocabulary in the schema. Add no more than five tags. Choose the most specific applicable tags.
42+
- `risk_level``low` by default. Use `medium` if the page touches ADA compliance, legal authority, data accuracy claims, or correction workflows. Use `high` only for pages with direct legal or safety consequences.
43+
- `authority_level``explanatory` by default. Use `draft` while content is in progress.
44+
- `review_status` — always set to `draft` for new pages.
45+
- `last_reviewed` — set to today's date in `YYYY-MM-DD` format.
46+
- `retrieval_priority``high` for the most important pages in a section, `medium` for most pages, `low` for supporting or supplementary content.
47+
- `assistant_behavior`:
48+
- `allow_inference: false` for all pages (default).
49+
- `requires_citation: true` for all pages (default).
50+
- `abstain_if_missing_context: true` for pages where the correct answer depends on the user's jurisdiction, dataset version, or other context not provided; `false` otherwise.
51+
- `do_not_claim` — list approximately one to five specific false or over-reaching claims an assistant might make that this page corrects. Phrase each as a complete declarative sentence. Leave empty (`[]`) if no obvious over-claims apply.
52+
- `related_pages` — list approximately two to five paths relative to `docs/` for closely related pages. Always include the section `index.md` (e.g. `assistant/os-connect/index.md`). Check `docs/assistant/dispatch.md` for available paths.
53+
54+
## Step 3 — Write the nine body sections
55+
56+
Write the full Markdown body in this exact order. Every heading must appear, spelled exactly as shown.
57+
58+
### `# [Page Title]`
59+
The H1 must match the `title` frontmatter value exactly.
60+
61+
### `## Short Answer`
62+
One to three short paragraphs. This is the text an assistant will surface directly in a reply. It must:
63+
- State the answer to the question (or define the concept/policy) clearly and completely.
64+
- Be self-contained — a reader with no other context should understand the answer.
65+
- Incorporate the user's provided minimal answer as its factual core. Do not paraphrase in ways that change meaning.
66+
- Stay under ~200 words.
67+
- Not contain "Yes" or "No" alone; provide a substantive statement.
68+
69+
### `## Significance`
70+
One paragraph (2–4 sentences) explaining why this topic matters to planners, jurisdictions, advocates, the public, or other identified audiences. Focus on operational or civic importance. Do not use the heading "Why This Matters".
71+
72+
### `## What This Means`
73+
Two to five bullet points (or a short paragraph) that unpack the answer in practical terms. If the page is a question, resolve the question definitively. If it is a concept, define it precisely. If it is a policy, state what follows from it.
74+
75+
### `## What This Does Not Mean`
76+
Two to four bullet points of explicit boundaries, non-claims, and common misinterpretations. Each bullet corrects a plausible wrong conclusion a reader might draw. These become `do_not_claim` candidates — if a bullet is strong enough, add it to the frontmatter field too.
77+
78+
### `## How To Use This`
79+
Audience-segmented guidance in one of these forms:
80+
- A short paragraph per audience (planners, jurisdictions, advocates, public, integrators) — only include audiences that actually apply.
81+
- A bulleted list of use cases, prefixed by the audience role in bold.
82+
83+
### `## Example`
84+
One concrete, specific scenario. Name a real-sounding actor (a city planner, a transit agency GIS analyst, a disability advocate, a Safe Routes coordinator), pose the situation in one sentence, and show how this page's content resolves or addresses it.
85+
86+
### `## Assistant Guidance`
87+
Two to five sentences of explicit behavioral instructions for chatbots consuming this page. Address:
88+
- When to cite this page.
89+
- Whether to abstain if context is missing.
90+
- Any `do_not_claim` items to watch for.
91+
- Whether to recommend the user consult a professional for legal, engineering, or safety questions.
92+
93+
### `## Related Concepts`
94+
An unordered list of Markdown links to related pages. Format each as:
95+
`- [Link text](relative-path-from-this-file-to-target.md)`
96+
97+
Always link the section index (e.g. `[OS-CONNECT knowledge base](index.md)`). Add two to four additional links to adjacent pages in `docs/assistant/dispatch.md` that are thematically related.
98+
99+
## Step 4 — Validate before writing
100+
101+
Before writing the file, check:
102+
103+
1. All nine headings are present and in order.
104+
2. Every required frontmatter field is populated (no empty strings, no `null`).
105+
3. `review_status` is `draft`.
106+
4. `last_reviewed` is today's date.
107+
5. `do_not_claim` items (if any) are complete declarative sentences.
108+
6. `related_pages` paths use the `docs/`-relative format, not file-system paths.
109+
7. The `## Short Answer` does not contradict the user's minimal answer.
110+
8. No section is omitted, even if its content is brief.
111+
112+
If any check fails, fix it before proceeding.
113+
114+
## Step 5 — Write the file
115+
116+
Write the completed file to the path given by the user. Overwrite the stub entirely.
117+
118+
## Step 6 — Update dispatch.md
119+
120+
Open `docs/assistant/dispatch.md`. Find the row for this file in the appropriate section table and change its `Status` from `stub` to `draft`. Use `replace_string_in_file` — do not rewrite the entire dispatch file.
121+
122+
## Step 7 — Confirm
123+
124+
Tell the user:
125+
- The file path written.
126+
- The `doc_type`, `risk_level`, and `retrieval_priority` values chosen and a very brief reasoning for each.
127+
- Any `do_not_claim` items added, so the user can verify they are accurate.
128+
- Whether `abstain_if_missing_context` was set to `true` and why.
129+
- The dispatch status updated from `stub``draft`.
130+
131+
If the user's minimal answer left any factual gap that would require TCAT staff knowledge to fill (e.g. a specific correction timeline, a named contact, a URL), flag it explicitly so the user can supply it in a follow-up review and editing phase.
132+
133+
---
134+
135+
## Quality Rules (apply throughout)
136+
137+
- **Never invent facts.** If the minimal answer does not state something, do not add it as though it were true. Use hedged language ("typically," "generally") only when the schema and product context genuinely support the hedge.
138+
- **Never contradict the minimal answer.** The user's seed content is authoritative.
139+
- **Preserve domain accuracy.** Do not rename, merge, or redefine TCAT products (TDEI, OS-CONNECT, Workspaces, AccessMap, Walksheds, OpenSidewalks, and AVIV ScoutRoute are each distinct).
140+
- **Keep the Short Answer self-contained.** A retrieval system may surface only that section.
141+
- **Match link paths to dispatch.md.** Only link to files that exist in the dispatch registry; do not invent file paths.
142+
- **Do not add extra headings** that duplicate or replace any of the nine required sections.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
description: "Review an Assistant Knowledge Base article for schema compliance, structure, and quality."
3+
name: "akb-review"
4+
argument-hint: "Path to docs/assistant/**/*.md to review, or leave blank to review the active file"
5+
agent: "AKB Reviewer"
6+
---
7+
8+
Review the specified Assistant Knowledge Base article in `docs/assistant/` against the schema in `docs/assistant/schema.md`.
9+
10+
Requirements:
11+
12+
- Review only; do not edit files.
13+
- Check frontmatter completeness and validity.
14+
- Check the nine required headings and their order.
15+
- Check `Short Answer`, boundary-setting, audience fit, and assistant guidance quality.
16+
- Apply the correct expectations for the article's `doc_type`.
17+
- Do not update `docs/assistant/dispatch.md`; remind the human to do that manually.
18+
19+
If no file path is provided, review the active file only if it is under `docs/assistant/`. Otherwise, ask for a target file.

.github/workflows/build-and-deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,33 @@ jobs:
2727
python-version: 3.x
2828
cache: pip
2929
- run: python -m pip install zensical
30+
- run: |
31+
mv docs/assistant /tmp/assistant-md
32+
python3 - <<'EOF'
33+
import os, shutil, re
34+
35+
src = '/tmp/assistant-md'
36+
dst = 'docs/assistant'
37+
38+
for root, dirs, files in os.walk(src):
39+
for fname in files:
40+
if not fname.endswith('.md'):
41+
continue
42+
src_file = os.path.join(root, fname)
43+
with open(src_file, encoding='utf-8') as f:
44+
content = f.read()
45+
if content.startswith('---'):
46+
end = content.find('---', 3)
47+
if end != -1:
48+
fm = content[3:end]
49+
if re.search(r'^\s*review_status\s*:\s*reviewed\s*$', fm, re.MULTILINE):
50+
rel = os.path.relpath(src_file, src)
51+
dst_file = os.path.join(dst, rel)
52+
os.makedirs(os.path.dirname(dst_file), exist_ok=True)
53+
shutil.copy2(src_file, dst_file)
54+
EOF
3055
- run: zensical build --clean
56+
- run: cp -r /tmp/assistant-md/. site/assistant/
3157
- uses: actions/upload-pages-artifact@v5
3258
with:
3359
path: site

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.md": "python-markdown"
4+
}
5+
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ Changes to the TCAT Wiki are documented here.
77
This project adheres to [Semantic Versioning](https://semver.org/) and
88
[Conventional Commits](https://www.conventionalcommits.org/).
99

10+
## v12.0.0 (2026-06-23)
11+
12+
### Features
13+
14+
- **Core**: Add assistant knowledge base
15+
- **Core**: Update build and deployment workflow to publish Assistant Knowledge Base pages as both user-facing Zensical-built HTML and raw Markdown
16+
- **Core**: Upgrade Zensical to 0.0.46
17+
1018
## v11.12.1 (2026-06-02)
1119

1220
### Fixes

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This guide explains how to contribute to the TCAT Wiki.
1414

1515
Note that, while minor external contributions are welcome, this guide is primarily intended for use by TCAT/GS staff.
1616

17-
_For a list of all guides on the TCAT Wiki, refer to the [Guides List](guides-list/index.md)._
17+
_For a list of all guides on the TCAT Wiki, refer to the [Guides List](https://taskarcenteratuw.github.io/tcat-wiki/guides-list/)._
1818

1919
---
2020

@@ -127,6 +127,8 @@ This section of the guide explains how to set up a Windows environment for contr
127127
128128
5. [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)
129129
130+
6. [Zensical Studio](https://marketplace.visualstudio.com/items?itemName=zensical.zensical-studio)
131+
130132
2. Clone the repository
131133
132134
```powershell

0 commit comments

Comments
 (0)