project-spec 0.7.0 → 0.9.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/README.md +74 -1
- package/bin/project-spec.mjs +8 -2
- package/package.json +1 -1
- package/skills/project-knowledge/SKILL.md +28 -9
- package/skills/project-knowledge/assets/viewer.html +139 -26
- package/skills/project-knowledge/references/format.md +12 -5
- package/skills/project-knowledge/references/gaps.md +1 -1
- package/skills/project-knowledge/scripts/coverage.py +200 -0
- package/skills/project-knowledge/scripts/knowledge.py +127 -21
- package/skills/project-knowledge/scripts/test_coverage.py +128 -0
- package/skills/project-knowledge/scripts/test_knowledge.py +155 -0
- package/skills/spec-change/references/gaps.md +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
import tempfile
|
|
5
|
+
import unittest
|
|
6
|
+
from contextlib import redirect_stderr, redirect_stdout
|
|
7
|
+
from io import StringIO
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
11
|
+
import coverage as c # noqa: E402
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CoverageTests(unittest.TestCase):
|
|
15
|
+
def setUp(self):
|
|
16
|
+
self.temp = tempfile.TemporaryDirectory()
|
|
17
|
+
self.repo = Path(self.temp.name).resolve() / 'repo'
|
|
18
|
+
self.vault = self.repo / 'knowledge/demo'
|
|
19
|
+
(self.vault / 'notes').mkdir(parents=True)
|
|
20
|
+
(self.vault / 'areas').mkdir()
|
|
21
|
+
self.page('00-index.md', 'index', 'index', areas=[], body='[[areas/chat]]')
|
|
22
|
+
self.page('areas/chat.md', 'chat', 'area', areas=[], body='[[notes/chats]]')
|
|
23
|
+
self.page('notes/chats.md', 'chats', sources=['src/chat/send.ts'],
|
|
24
|
+
body='A message is refused with "Message can’t be empty". At most 10 photos (`CHAT_MAX_MEDIA`).\n\n'
|
|
25
|
+
'| ID | Rule |\n| --- | --- |\n| BR-CHAT-01 | Only group chats can be renamed, by a member \\| staff. |')
|
|
26
|
+
self.code('src/chat/send.ts', '''
|
|
27
|
+
export const CHAT_MAX_MEDIA = 10;
|
|
28
|
+
export const COLD_OUTREACH_PER_HOUR: number = 5; // new people
|
|
29
|
+
const RETRY_MS = 60 * 1000
|
|
30
|
+
const queryKey = "chats.list";
|
|
31
|
+
throw new Error("Message can't be empty");
|
|
32
|
+
throw new Error('Only group chats can be renamed');
|
|
33
|
+
throw new Error("You cannot remove yourself");
|
|
34
|
+
console.error("Failed to load the chat list");
|
|
35
|
+
const cls = "flex items-center gap-2 Text here";
|
|
36
|
+
const sql = "SELECT id FROM chats WHERE owner = 1";
|
|
37
|
+
''')
|
|
38
|
+
self.code('src/chat/window/Header.tsx', '<Button>Back to chat list</Button>\n<p>{count} unread</p>\nconst t = `Hello ${name}, welcome back`;')
|
|
39
|
+
self.code('src/chat/window/deep/Picker.tsx', 'const label = "Smileys and people";')
|
|
40
|
+
self.code('src/chat/send.test.ts', 'it("says this in a test only", () => {})')
|
|
41
|
+
self.code('src/chat/__tests__/more.ts', 'const s = "Only in a test folder";')
|
|
42
|
+
self.code('src/orders/pay.py', 'MAX_TOTAL = 5000\nmessage = "The order was already paid"\n')
|
|
43
|
+
self.code('database/migrations/001.sql', "INSERT INTO t VALUES ('A sentence in a migration');")
|
|
44
|
+
self.code('node_modules/x/index.js', 'const s = "A sentence in a dependency";')
|
|
45
|
+
self.code('src/help/article.ts', '\n'.join(f'const p{i} = "This is paragraph number {i} of an article";' for i in range(45)))
|
|
46
|
+
(self.repo / 'README.md').write_text('Not code. "A sentence in the readme file"', encoding='utf-8')
|
|
47
|
+
|
|
48
|
+
def tearDown(self):
|
|
49
|
+
self.temp.cleanup()
|
|
50
|
+
|
|
51
|
+
def page(self, path, ident, ptype='note', areas=None, sources=None, body=''):
|
|
52
|
+
meta = {'id': ident, 'title': 'Page ' + ident, 'type': ptype, 'status': 'current', 'areas': ['chat'] if areas is None else areas,
|
|
53
|
+
'sources': sources or [], 'updated': '2026-11-18'}
|
|
54
|
+
(self.vault / path).write_text('---\n' + ''.join(f'{key}: {json.dumps(value)}\n' for key, value in meta.items()) + '---\n' + body, encoding='utf-8')
|
|
55
|
+
|
|
56
|
+
def code(self, path, text):
|
|
57
|
+
file = self.repo / path
|
|
58
|
+
file.parent.mkdir(parents=True, exist_ok=True)
|
|
59
|
+
file.write_text(text, encoding='utf-8')
|
|
60
|
+
|
|
61
|
+
def run_cli(self, *args):
|
|
62
|
+
out, err = StringIO(), StringIO()
|
|
63
|
+
with redirect_stdout(out), redirect_stderr(err):
|
|
64
|
+
status = c.main(['--repo', str(self.repo), *args])
|
|
65
|
+
return status, out.getvalue(), err.getvalue()
|
|
66
|
+
|
|
67
|
+
def measured(self, *prefixes):
|
|
68
|
+
import knowledge
|
|
69
|
+
notes = knowledge.load_vault(self.repo, self.vault, freshness=False, absent=[])[0]
|
|
70
|
+
return c.measure(self.repo, self.vault, notes, prefixes)
|
|
71
|
+
|
|
72
|
+
def test_reads_only_the_application_code(self):
|
|
73
|
+
self.assertEqual(sorted(self.measured()), ['src/chat/send.ts', 'src/chat/window/Header.tsx', 'src/chat/window/deep/Picker.tsx',
|
|
74
|
+
'src/help/article.ts', 'src/orders/pay.py'])
|
|
75
|
+
# with Git, an ignored folder is left out as well, and an untracked file is still read
|
|
76
|
+
subprocess.run(['git', '-C', str(self.repo), 'init', '-q'], check=True)
|
|
77
|
+
(self.repo / '.gitignore').write_text('src/orders/\n', encoding='utf-8')
|
|
78
|
+
self.assertNotIn('src/orders/pay.py', self.measured())
|
|
79
|
+
self.assertIn('src/chat/send.ts', self.measured())
|
|
80
|
+
|
|
81
|
+
def test_finds_the_sentences_and_numbers_no_page_mentions(self):
|
|
82
|
+
files = self.measured()
|
|
83
|
+
send = files['src/chat/send.ts']
|
|
84
|
+
self.assertEqual((send['cited'], send['sentences'], send['limits']), (True, 3, 3))
|
|
85
|
+
self.assertEqual(send['unquoted'], ['You cannot remove yourself'], 'a curly apostrophe and a table row still match; logs, class lists and queries are not sentences')
|
|
86
|
+
self.assertEqual(send['unnamed'], [('COLD_OUTREACH_PER_HOUR', '5'), ('RETRY_MS', '60 * 1000')])
|
|
87
|
+
self.assertEqual(files['src/chat/window/Header.tsx']['unquoted'], ['Back to chat list'], 'text between tags counts; text with a placeholder does not')
|
|
88
|
+
self.assertEqual(files['src/orders/pay.py']['unnamed'], [('MAX_TOTAL', '5000')])
|
|
89
|
+
article = files['src/help/article.ts']
|
|
90
|
+
self.assertEqual((article['content'], article['sentences'], article['unquoted']), (True, 0, []), 'an article counts as a file only')
|
|
91
|
+
|
|
92
|
+
def test_groups_by_folder_and_keeps_an_uncited_folder_as_one_line(self):
|
|
93
|
+
groups = c.folders(self.measured())
|
|
94
|
+
self.assertEqual(sorted(groups), ['src/chat', 'src/chat/window', 'src/help', 'src/orders'])
|
|
95
|
+
self.assertEqual(groups['src/chat/window'], {'files': 2, 'lines': 4, 'cited': 0, 'sentences': 2, 'unquoted': 2, 'limits': 0, 'unnamed': 0})
|
|
96
|
+
self.assertEqual((groups['src/chat']['files'], groups['src/chat']['cited']), (1, 1))
|
|
97
|
+
# nothing cited anywhere: one line per top folder, and never above the folder that was asked for
|
|
98
|
+
self.page('notes/chats.md', 'chats', sources=['README.md'])
|
|
99
|
+
self.assertEqual(sorted(c.folders(self.measured())), ['src'])
|
|
100
|
+
self.assertEqual(sorted(c.folders(self.measured('src/chat'), ['src/chat'])), ['src/chat'])
|
|
101
|
+
|
|
102
|
+
def test_report_lists_what_to_read(self):
|
|
103
|
+
status, out, err = self.run_cli()
|
|
104
|
+
self.assertEqual((status, err), (0, ''))
|
|
105
|
+
self.assertIn('coverage: 5 code files, ', out)
|
|
106
|
+
self.assertIn('pages cite 1 of them', out)
|
|
107
|
+
self.assertIn('6 sentences a person can see, 4 on no page; 4 named numbers, 3 on no page', out)
|
|
108
|
+
self.assertIn('1 files that are mostly text (articles, templates) count as files only', out)
|
|
109
|
+
self.assertLess(out.index('src/chat/window'), out.index('src/help'), 'the folder with the most to read comes first')
|
|
110
|
+
self.assertNotIn('things under', out)
|
|
111
|
+
status, out, _ = self.run_cli('--path', 'src/chat/')
|
|
112
|
+
self.assertIn('coverage: 3 code files', out)
|
|
113
|
+
self.assertIn('5 things under src/chat that no page mentions:', out)
|
|
114
|
+
self.assertIn(' src/chat/send.ts says: You cannot remove yourself', out)
|
|
115
|
+
self.assertIn(' src/chat/send.ts sets: RETRY_MS = 60 * 1000', out)
|
|
116
|
+
self.assertIn('2 of 3 files there are cited by no page', out)
|
|
117
|
+
self.assertEqual(self.run_cli('--path', 'nowhere')[1].strip(), 'coverage: no code files found under nowhere')
|
|
118
|
+
|
|
119
|
+
def test_a_vault_with_errors_is_reported_and_still_measured(self):
|
|
120
|
+
self.page('notes/bad.md', 'bad', sources=['src/chat/send.ts'], body='[[missing-page]]')
|
|
121
|
+
status, out, err = self.run_cli()
|
|
122
|
+
self.assertEqual(status, 0)
|
|
123
|
+
self.assertIn('the vault has 1 errors', err)
|
|
124
|
+
self.assertIn('coverage: 5 code files', out)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
if __name__ == '__main__':
|
|
128
|
+
unittest.main()
|
|
@@ -583,6 +583,128 @@ class GapLayerTests(Fixture):
|
|
|
583
583
|
self.assertEqual(k.vault_pending(inner.resolve(), (inner / 'vault').resolve()), [])
|
|
584
584
|
k._history_cache.clear()
|
|
585
585
|
|
|
586
|
+
def built(self, *args):
|
|
587
|
+
out = self.root / 'site/spec.html'
|
|
588
|
+
status, printed, err = self.run_cli('build', '--out', str(out), *args)
|
|
589
|
+
data = json.loads(re.search(r'<script id="knowledge-data" type="application/json">\s*(.*?)\s*</script>', out.read_text(encoding='utf-8'), re.S).group(1)) if out.is_file() else None
|
|
590
|
+
return status, printed, err, data
|
|
591
|
+
|
|
592
|
+
def refused(self, *args):
|
|
593
|
+
"""What a command that stops with a usage error says."""
|
|
594
|
+
err = StringIO()
|
|
595
|
+
with self.assertRaises(SystemExit), redirect_stdout(StringIO()), redirect_stderr(err):
|
|
596
|
+
k.main([*args, '--repo', str(self.repo), '--vault', str(self.vault)])
|
|
597
|
+
return err.getvalue()
|
|
598
|
+
|
|
599
|
+
def test_build_writes_one_page_for_a_server_without_source_text(self):
|
|
600
|
+
status, printed, err, data = self.built()
|
|
601
|
+
self.assertEqual((status, err), (0, 'WARNING: notes/n.md: unbaselined source source.txt\n'))
|
|
602
|
+
self.assertIn('build: wrote ' + str(self.root / 'site/spec.html'), printed)
|
|
603
|
+
self.assertIn('their text is not included', printed)
|
|
604
|
+
self.assertEqual((data['built'], data.get('live'), data['files'], data['sourceUrl'], data['commit']), (True, None, {}, '', ''))
|
|
605
|
+
self.assertEqual({n['id'] for n in data['nodes']}, {'a', 'index', 'n'})
|
|
606
|
+
self.assertNotIn('evidence', (self.root / 'site/spec.html').read_text(encoding='utf-8'))
|
|
607
|
+
# nothing appeared in the vault, and no temporary file was left beside the page
|
|
608
|
+
self.assertFalse((self.vault / '.knowledge').exists())
|
|
609
|
+
self.assertEqual([f.name for f in (self.root / 'site').iterdir()], ['spec.html'])
|
|
610
|
+
# the text of cited files only when asked for, with a warning about who may see it
|
|
611
|
+
status, printed, _, data = self.built('--with-sources')
|
|
612
|
+
self.assertEqual((status, data['files']['source.txt']['text']), (0, 'evidence'))
|
|
613
|
+
self.assertIn('the text of 1 cited source files is inside the file', printed)
|
|
614
|
+
|
|
615
|
+
def test_build_can_run_where_part_of_the_repository_is_missing(self):
|
|
616
|
+
self.note('notes/m.md', 'm', sources=['source.txt', 'Dockerfile'])
|
|
617
|
+
status, _, err, data = self.built()
|
|
618
|
+
self.assertEqual((status, data), (1, None))
|
|
619
|
+
self.assertIn('source is missing or not a file', err)
|
|
620
|
+
status, printed, err, data = self.built('--allow-missing-sources')
|
|
621
|
+
self.assertEqual(status, 0)
|
|
622
|
+
self.assertIn('build: 1 cited files are not in this folder, so nobody compared them with the pages: Dockerfile', printed)
|
|
623
|
+
self.assertNotIn('Dockerfile', err)
|
|
624
|
+
self.note('notes/o.md', 'o', sources=['Dockerfile'])
|
|
625
|
+
data = self.built('--allow-missing-sources')[3]
|
|
626
|
+
pages = {n['id']: (n['sources'], n['stale']) for n in data['nodes']}
|
|
627
|
+
self.assertEqual(pages['o'], (['Dockerfile'], False), 'a file nobody could read does not mark its page as changed')
|
|
628
|
+
self.assertEqual(pages['m'], (['source.txt', 'Dockerfile'], True), 'source.txt has no accepted fingerprint')
|
|
629
|
+
(self.vault / 'notes/o.md').unlink()
|
|
630
|
+
# a folder where a file should be is still an error, and so is the same vault for check
|
|
631
|
+
(self.repo / 'Dockerfile').mkdir()
|
|
632
|
+
self.assertEqual(self.built('--allow-missing-sources')[0], 1)
|
|
633
|
+
(self.repo / 'Dockerfile').rmdir()
|
|
634
|
+
self.assertEqual(self.run_cli('check')[0], 1)
|
|
635
|
+
self.assertIn('only for build', self.refused('check', '--allow-missing-sources'))
|
|
636
|
+
|
|
637
|
+
def test_build_and_serve_work_where_git_is_not_installed(self):
|
|
638
|
+
import os
|
|
639
|
+
from unittest import mock
|
|
640
|
+
k._history_cache.clear()
|
|
641
|
+
self.vault.rename(self.repo / 'vault')
|
|
642
|
+
self.vault = self.repo / 'vault'
|
|
643
|
+
self.git('init', '-q')
|
|
644
|
+
self.git('add', '-A')
|
|
645
|
+
self.git('commit', '-q', '-m', 'First')
|
|
646
|
+
empty = self.root / 'no-tools'
|
|
647
|
+
empty.mkdir()
|
|
648
|
+
with mock.patch.dict(os.environ, {'PATH': str(empty)}):
|
|
649
|
+
status, printed, err, data = self.built()
|
|
650
|
+
self.assertEqual((status, data['commit'], data['history'], data['pending']), (0, '', [], []), err)
|
|
651
|
+
self.assertNotIn('commit ', printed)
|
|
652
|
+
self.assertIn('knowledge-data', k.live_page(self.repo.resolve(), self.vault.resolve()))
|
|
653
|
+
self.assertIn('--ignore-dirty needs --repo to be a Git work tree', self.refused('check', '--ignore-dirty'))
|
|
654
|
+
k._history_cache.clear()
|
|
655
|
+
self.assertEqual([c['subject'] for c in self.built()[3]['history']], ['First'], 'with Git back, the history is too')
|
|
656
|
+
|
|
657
|
+
def test_build_links_cited_files_to_the_commit_it_was_built_from(self):
|
|
658
|
+
k._history_cache.clear()
|
|
659
|
+
self.vault.rename(self.repo / 'vault')
|
|
660
|
+
self.vault = self.repo / 'vault'
|
|
661
|
+
out = str(self.root / 'site/spec.html')
|
|
662
|
+
self.assertIn('--repo is not a Git work tree with a commit', self.refused('build', '--out', out, '--source-url', 'https://github.com/o/r/blob/{commit}'))
|
|
663
|
+
self.git('init', '-q')
|
|
664
|
+
self.git('add', '-A')
|
|
665
|
+
self.git('commit', '-q', '-m', 'First')
|
|
666
|
+
head = self.git('rev-parse', 'HEAD').strip()
|
|
667
|
+
status, printed, _, data = self.built('--source-url', 'https://github.com/o/r/blob/{commit}/')
|
|
668
|
+
self.assertEqual((status, data['commit'], data['sourceUrl']), (0, head, 'https://github.com/o/r/blob/' + head))
|
|
669
|
+
self.assertIn('commit ' + head[:7], printed)
|
|
670
|
+
self.assertEqual([c['subject'] for c in data['history']], ['First'])
|
|
671
|
+
self.assertNotIn('shallow clone', printed)
|
|
672
|
+
for bad in ('javascript:alert(1)', 'github.com/o/r', 'https://', 'https://x.example/a b'):
|
|
673
|
+
with self.subTest(url=bad):
|
|
674
|
+
self.assertIn('--source-url must be an http(s) address', self.refused('build', '--out', out, '--source-url', bad))
|
|
675
|
+
|
|
676
|
+
def test_build_refuses_a_broken_vault_and_a_file_inside_the_vault(self):
|
|
677
|
+
for out in (self.vault / 'spec.html', self.vault / 'notes/deep/spec.html', self.root):
|
|
678
|
+
with self.subTest(out=out):
|
|
679
|
+
self.assertIn('--out must be a file outside the vault', self.refused('build', '--out', str(out)))
|
|
680
|
+
self.assertFalse((self.vault / 'spec.html').exists() or (self.vault / 'notes/deep').exists())
|
|
681
|
+
for args in (['build'], ['check', '--out', 'x.html'], ['serve', '--with-sources'], ['check', '--source-url', 'https://x.example']):
|
|
682
|
+
with self.subTest(args=args):
|
|
683
|
+
self.assertIn('build', self.refused(*args))
|
|
684
|
+
self.note('notes/bad.md', 'bad', sources=['source.txt'], body='[[<absent>]]')
|
|
685
|
+
status, _, err, data = self.built()
|
|
686
|
+
self.assertEqual((status, data), (1, None))
|
|
687
|
+
self.assertIn('missing wikilink <absent>', err)
|
|
688
|
+
|
|
689
|
+
def test_history_of_a_shallow_clone_leaves_out_the_commit_without_parents(self):
|
|
690
|
+
k._history_cache.clear()
|
|
691
|
+
self.vault.rename(self.repo / 'vault')
|
|
692
|
+
self.vault = self.repo / 'vault'
|
|
693
|
+
self.git('init', '-q')
|
|
694
|
+
self.git('add', '-A')
|
|
695
|
+
self.git('commit', '-q', '-m', 'First')
|
|
696
|
+
self.note('notes/n.md', 'n', sources=['source.txt'], summary='Second line.')
|
|
697
|
+
self.git('commit', '-q', '-am', 'Second')
|
|
698
|
+
self.note('notes/n.md', 'n', sources=['source.txt'], summary='Third line.')
|
|
699
|
+
self.git('commit', '-q', '-am', 'Third')
|
|
700
|
+
clone = self.root / 'clone'
|
|
701
|
+
subprocess.run(['git', 'clone', '-q', '--depth', '2', self.repo.resolve().as_uri(), str(clone)], check=True, capture_output=True)
|
|
702
|
+
history = k.vault_history(clone.resolve(), (clone / 'vault').resolve())
|
|
703
|
+
self.assertEqual([(c['subject'], [p['status'] for p in c['pages']]) for c in history], [('Third', ['changed'])],
|
|
704
|
+
'Second is where the clone stops: Git would show every page as added there')
|
|
705
|
+
self.repo, self.vault = clone, clone / 'vault'
|
|
706
|
+
self.assertIn('build: this is a shallow clone', self.built()[1])
|
|
707
|
+
|
|
586
708
|
def test_serve_finds_the_single_vault_and_asks_when_unsure(self):
|
|
587
709
|
with self.assertRaisesRegex(ValueError, 'no vault found under knowledge/; pass --vault'):
|
|
588
710
|
k.find_vault(self.repo)
|
|
@@ -603,6 +725,39 @@ class GapLayerTests(Fixture):
|
|
|
603
725
|
self.assertEqual(k.main(['check', '--repo', str(self.repo)]), 0)
|
|
604
726
|
self.assertIn('check: 1 notes', out.getvalue())
|
|
605
727
|
|
|
728
|
+
def test_a_feature_too_big_for_one_page_has_parts(self):
|
|
729
|
+
self.note('notes/chats.md', 'chats', sources=['source.txt'], body='Parts: [[notes/group-chats|group chats]].')
|
|
730
|
+
self.note('notes/group-chats.md', 'group-chats', sources=['source.txt'], parent='chats')
|
|
731
|
+
status, out, err = self.run_cli('check')
|
|
732
|
+
self.assertEqual(status, 0, err)
|
|
733
|
+
notes, edges, errors, _, _ = k.load_vault(self.repo.resolve(), self.vault.resolve())
|
|
734
|
+
self.assertIn(('chats', 'group-chats'), edges)
|
|
735
|
+
self.assertEqual(k.node_of(next(n for n in notes if n['meta']['id'] == 'group-chats'))['parent'], 'chats')
|
|
736
|
+
cases = (
|
|
737
|
+
(dict(parent='chats'), 'Parts: none listed.', 'notes/group-chats.md: its feature notes/chats.md does not link to it'),
|
|
738
|
+
(dict(parent='nobody'), None, 'parent nobody is not the id of an existing note'),
|
|
739
|
+
(dict(parent='a'), None, 'parent a is not the id of an existing note'),
|
|
740
|
+
(dict(parent='group-chats'), None, 'parent must name a different note'),
|
|
741
|
+
(dict(parent=''), None, 'parent is only valid on note pages and names the feature note'),
|
|
742
|
+
)
|
|
743
|
+
for extra, parent_body, message in cases:
|
|
744
|
+
with self.subTest(message=message):
|
|
745
|
+
self.note('notes/chats.md', 'chats', sources=['source.txt'], body=parent_body or 'Parts: [[notes/group-chats|group chats]].')
|
|
746
|
+
self.note('notes/group-chats.md', 'group-chats', sources=['source.txt'], **extra)
|
|
747
|
+
status, _, err = self.run_cli('check')
|
|
748
|
+
self.assertEqual(status, 1)
|
|
749
|
+
self.assertIn(message, err)
|
|
750
|
+
# three levels and no more, and a part stays in its feature's area
|
|
751
|
+
self.note('notes/chats.md', 'chats', sources=['source.txt'], body='[[notes/group-chats|group chats]] [[notes/renaming|renaming]]')
|
|
752
|
+
self.note('notes/group-chats.md', 'group-chats', sources=['source.txt'], parent='chats', body='[[notes/renaming|renaming]]')
|
|
753
|
+
self.note('notes/renaming.md', 'renaming', sources=['source.txt'], parent='group-chats')
|
|
754
|
+
self.assertIn('parent group-chats is itself a part of chats; a part belongs to a feature, not to another part', self.run_cli('check')[2])
|
|
755
|
+
self.note('areas/b.md', 'b', 'area', areas=[])
|
|
756
|
+
self.note('notes/renaming.md', 'renaming', sources=['source.txt'], parent='chats', areas=['b'])
|
|
757
|
+
self.assertIn('parent chats is in another area', self.run_cli('check')[2])
|
|
758
|
+
self.note('areas/a.md', 'a', 'area', areas=[], parent='chats')
|
|
759
|
+
self.assertIn('parent is only valid on note pages', self.run_cli('check')[2])
|
|
760
|
+
|
|
606
761
|
def test_area_pages_are_maps_without_tables_or_links_into_notes(self):
|
|
607
762
|
table = '| Screen | What it does |\n| --- | --- |\n| Profile | Edits the name. [[notes/n|Profile]] |\n'
|
|
608
763
|
for body in (table, '| a | b |\n|:-|-:|\n| 1 | 2 |', 'a | b\n--- | ---\n1 | 2', '| one column |\n| --- |\n| x |'):
|
|
@@ -27,7 +27,7 @@ A gap must not have `status`; its progress is carried by `recheck` and `decision
|
|
|
27
27
|
| `decided_by` | when `decision` is `accepted`, `rejected` or `deferred` | a person's name; the value `agent` is an error |
|
|
28
28
|
| `decided_on` | when `decision` is `accepted`, `rejected` or `deferred` | `YYYY-MM-DD` |
|
|
29
29
|
| `duplicate_of` | when `decision` is `duplicate` | id of another existing gap (not itself) |
|
|
30
|
-
| `priority`, `confidence` | optional, gap and plan pages only | short strings, e.g. `"high"` |
|
|
30
|
+
| `priority`, `confidence` | optional, gap and plan pages only | short strings, e.g. `"high"`. Use `high`, `medium` or `low` for `priority` (or `P0` to `P4`): the viewer lists the most urgent gap of each state first and can show one priority only. |
|
|
31
31
|
|
|
32
32
|
`decided_by` and `decided_on` are also allowed on `done` and `duplicate` but not required. With `outdated`, `rechecked_by` and `rechecked_on` stay in place as the record of the last recheck actually done. A fresh recheck replaces all three fields and adds a new dated entry to the `Recheck` section; keep the older entries.
|
|
33
33
|
|