chapterhouse 0.9.0 → 0.9.2

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.
@@ -104,7 +104,8 @@ tags: [engineering, made-up-tag]
104
104
  `, { allowedTags: ["engineering", "release"] });
105
105
  assert.equal(result.valid, false);
106
106
  assert.deepEqual(result.errors.map((error) => error.rule), ["unknown-tag"]);
107
- assert.match(result.errors[0]?.message ?? "", /Add it to `pages\/_meta\/taxonomy\.md` first\./);
107
+ assert.match(result.errors[0]?.message ?? "", /made-up-tag/);
108
+ assert.match(result.errors[0]?.message ?? "", /Valid tags: engineering, release/);
108
109
  });
109
110
  test("parseProjectRulesFrontmatter parses typed hard-rule fields and flags unknown keys", async () => {
110
111
  const { parseProjectRulesFrontmatter } = await loadFrontmatterModule();
@@ -77,7 +77,7 @@ export function upsertWikiPage(path, frontmatter, summary) {
77
77
  const db = getDb();
78
78
  const normalizedPath = normalizeWikiPath(path);
79
79
  const title = frontmatter.title ?? basenameTitle(normalizedPath);
80
- const entityType = frontmatter.metadata?.["entity_type"] ?? null;
80
+ const entityType = frontmatter.metadata?.["entity_type"] ?? categoryOfPath(normalizedPath);
81
81
  const tags = JSON.stringify(frontmatter.tags ?? []);
82
82
  const lastUpdated = frontmatter.updated ?? new Date().toISOString();
83
83
  db.prepare(`
@@ -331,6 +331,22 @@ export async function ingestSource(source, type, topic, session) {
331
331
  // ---------------------------------------------------------------------------
332
332
  // Type auto-detection
333
333
  // ---------------------------------------------------------------------------
334
+ const URL_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
335
+ export function looksLikeLocalFilePath(source) {
336
+ const trimmed = source.trim();
337
+ if (!trimmed)
338
+ return false;
339
+ if (/^[a-z]:[\\/]/i.test(trimmed))
340
+ return true;
341
+ if (trimmed.startsWith("file://") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~/")) {
342
+ return true;
343
+ }
344
+ if (URL_SCHEME_RE.test(trimmed))
345
+ return false;
346
+ if (/\s/.test(trimmed))
347
+ return false;
348
+ return trimmed.includes("/") || trimmed.includes("\\") || /\.[a-z0-9]+$/i.test(trimmed);
349
+ }
334
350
  export function detectSourceType(source) {
335
351
  const trimmed = source.trim();
336
352
  if (trimmed.startsWith("http://") || trimmed.startsWith("https://")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chapterhouse",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Chapterhouse — a team-level AI assistant for engineering teams, built on the GitHub Copilot SDK. Web UI only.",
5
5
  "bin": {
6
6
  "chapterhouse": "dist/cli.js"