merge: integrate database documents, preserve all proposals and keep CI main-only
This commit is contained in:
@@ -10,7 +10,9 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
DATA = json.loads((ROOT / 'content/research/ai-companies.seed.json').read_text())
|
||||
AUDIT = json.loads((ROOT / 'content/research/ai-companies.coverage.json').read_text())
|
||||
SOURCES = json.loads((ROOT / 'content/research/ai-companies.sources.json').read_text())
|
||||
TARGET = ROOT / 'content/docs/ai-company-research/02-coverage-and-gaps.md'
|
||||
TARGET = ROOT / '.artifacts/reports/02-coverage-and-gaps.md'
|
||||
SOURCE_SLUG = 'ai-company-research/02-coverage-and-gaps'
|
||||
|
||||
BASE = '/docs/other-research/ai-company-research/overview'
|
||||
|
||||
|
||||
@@ -208,13 +210,18 @@ def render():
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--check', action='store_true')
|
||||
parser.add_argument('--document-export', type=Path)
|
||||
args = parser.parse_args()
|
||||
content = render()
|
||||
if args.check:
|
||||
if not TARGET.exists() or TARGET.read_text() != content:
|
||||
sys.exit('Research coverage report differs; review and regenerate')
|
||||
print('Research coverage accounting and report are consistent')
|
||||
if args.document_export is not None:
|
||||
bundle = json.loads(args.document_export.read_text())
|
||||
stored = next((d['content'] for d in bundle['documents'] if d['sourceSlug'] == SOURCE_SLUG), None)
|
||||
if stored != content:
|
||||
sys.exit('Research coverage report differs; review and regenerate')
|
||||
print('Research coverage accounting verified; supplied document export compared when requested')
|
||||
else:
|
||||
TARGET.parent.mkdir(parents=True, exist_ok=True)
|
||||
TARGET.write_text(content)
|
||||
print(TARGET.relative_to(ROOT))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user