Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Research navigation and public source checks
push:
branches: [chatgpt/navigation-price-20260924]
pull_request:
paths: ['README.md', 'docs/**', 'tools/navigation_check.py', 'tests/test_navigation*.py', '.github/workflows/navigation.yml']
paths: ['README.md', 'docs/**', 'formal/README.md', 'formal/GLOSSARY.md', 'formal/REVIEW_LANE.md', 'tools/navigation_check.py', 'tests/test_navigation*.py', '.github/workflows/navigation.yml']
workflow_dispatch:
permissions:
contents: read
Expand Down
23 changes: 22 additions & 1 deletion tests/test_navigation_workflow.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
"""Static contract for the navigation workflow's top-level test path filter.
"""Static contract for the navigation workflow's page and test path filters.

This reads the workflow's existing single-line, quoted flow-list syntax. It
is not a general YAML parser, a GitHub event replay, or a whole-workflow audit.
The basename matcher is limited to direct children of tests/: unlike a raw
fnmatch over the whole path, its '*' cannot consume a directory separator.
Declared-page coverage recognizes literal paths and the existing docs/**
pattern only; it deliberately does not implement general GitHub glob matching.
"""
from __future__ import annotations

import ast
import fnmatch
import json
from pathlib import Path
import re
import unittest
Expand Down Expand Up @@ -52,11 +55,29 @@ def test_filter_is_narrow_and_retains_existing_triggers(self):
self.assertEqual(self.paths, [
'README.md',
'docs/**',
'formal/README.md',
'formal/GLOSSARY.md',
'formal/REVIEW_LANE.md',
'tools/navigation_check.py',
'tests/test_navigation*.py',
'.github/workflows/navigation.yml',
])

def test_every_declared_navigation_page_has_a_trigger(self):
manifest = json.loads((ROOT / 'docs' / 'NAVIGATION.json').read_text(
encoding='utf-8'))
pages = manifest['pages']
self.assertIsInstance(pages, list)
self.assertTrue(pages, 'declared-page coverage must not be empty')
for page in pages:
with self.subTest(page=page):
self.assertIsInstance(page, str)
self.assertTrue(
page in self.paths
or ('docs/**' in self.paths and page.startswith('docs/')),
f'declared navigation page lacks a trigger: {page}',
)

def test_original_navigation_test_is_selected(self):
self.assertTrue(selected_test_path('tests/test_navigation.py', self.paths))

Expand Down
Loading