Skip to content

v0.2.0: audit remediation (senses as meanings, public API, caching, governance, CI gates) - #226

Draft
amanthanvi wants to merge 6 commits into
mainfrom
audit/implementation
Draft

amanthanvi wants to merge 6 commits into
mainfrom
audit/implementation

Conversation

@amanthanvi

Copy link
Copy Markdown
Owner

Summary

Implements the full 54-item audit roadmap (20 minimal, 19 moderate, 10 major, 5 radical) and ships it as v0.2.0.

  • Senses are meanings. A sense carries per-source attestations (sense_definitions), a stable slug for #s-<slug> deep links, and a concordance view when sources differ. Ingest matches new definitions to existing senses by trigram similarity and holds ambiguous cases for review instead of publishing them.
  • Search runs in one round trip with the trigram index restored, expansion and alias buckets, totals, spelling suggestions, and meaning-level search (/api/v1/search?scope=senses).
  • Provenance and licensing: user-facing license statements and links on every citation, a per-sense "How this was sourced" disclosure, citation record downloads, content mode derived from source policy, and a license gate that never auto-publishes WARN.
  • Public read API v1 with OpenAPI, ETags, CORS, and a dataset export. Data is cached with tags and invalidated on publish; the anonymous session cookie and view tracking are gone.
  • Tag governance: assigned_by on every link, additive auto-tagging with a hit threshold, tag kinds and hierarchy, one definition list.
  • Editorial layer in git: content/entries/**/*.yaml synced by the worker.
  • Security: audit-log role check, IP-first rate limiting behind trusted proxies, required salts in production, zod validation and central role checks across admin, role revocation, CSP form-action and reporting.
  • CI: SHA-pinned workflows with format, strict lint, migration drift, coverage thresholds, Playwright with axe, Lighthouse budgets, CodeQL security-extended, and an SBOM; noUncheckedIndexedAccess on.

Verification

Check Result
lint, strict lint, typecheck, format, versions, drift pass
unit and integration tests 410 passed across 39 files
production build pass
Playwright + axe against a seeded server 16 of 16 passed
db coverage 94% lines, 83% branches

Deploy notes

  • Set SYNAC_RATE_LIMIT_SALT, SYNAC_REVALIDATE_SECRET, and SYNAC_AUTOPUBLISH_TIER1 before deploying. Auto-publish is off when unset.
  • SYNAC_SESSION_HASH_SALT is no longer read. .env.example still lists it; the file is protected in the author's tooling and needs a manual edit.
  • Run pnpm --filter @synac/db db:migrate:deploy before starting the new build; the migration backfills sense slugs and attestations from existing provenance.
  • After merge, tag v0.2.0 on the merge commit. v0.1.5 was tagged retroactively on 462dd52.

- Migration 20260910120000_audit_wave1: restore the trigram index, add
  composite and uniqueness indexes, sense_definitions, sense slugs,
  source license fields, tag kind/parent/assigned_by, trigger-maintained
  sense_search, markdown-free entry search document; drop entry_views.
- Search runs in one round trip with expansion and alias buckets,
  totals, spelling suggestions, and meaning-level search.
- Auto-tagging is additive with a hit threshold and one definition list.
- Role sync revokes allowlist removals; disabled users stay disabled.
- Shared apply path for ingest proposals and shared text/JSON helpers.
- Seed carries user-facing license statements and a two-sense SOC entry.
- Migration drift check with an allowlist for raw-SQL objects.
… registry

- Definitions attach to existing senses by similarity; ambiguous cases
  open a sense flagged needs_label and block auto-publish.
- NIST emits one sense per definition with real locators; RFC and MITRE
  runs resume instead of bailing on an unchanged document.
- Content mode comes from source policy; the license gate consults it.
- Adapters share an interface, persistence, robots and rate-limit
  handling, a cheerio-based HTML layer, and package-derived versions.
- Relationships from RFC See lines, NICCS related terms, ATT&CK tactics.
- Editorial layer synced from content/**/*.yaml; hourly rate-limit
  bucket cleanup; auto-publish fails closed when unset.
- Public read API v1 with OpenAPI, ETags, CORS, dataset export,
  citation records, health check, and a revalidation hook.
- Data cached with tags and invalidated on publish; no anonymous cookie.
- Entry pages: concordance across sources, provenance disclosure,
  JSON-LD, sense deep links, accessible citation popovers, mobile
  sense index, contrast fixes, one EntryListItem and TypeBadge.
- Admin: zod validation, one role check, attestation editing, needs-label
  queue, tag assignment provenance, source license fields.
- Rate limiter keys on IP behind trusted proxies and covers the search
  page; CSP gains form-action and reporting; salts required in prod.
- SHA-pinned workflows; format, strict lint, prisma validate, migration
  drift, coverage thresholds, Playwright with axe, Lighthouse budgets,
  CodeQL security-extended, cdxgen SBOM, version consistency.
- noUncheckedIndexedAccess and type-aware lint rules on.
- docker-compose with all local databases, Dockerfiles, Railway health
  check, issue templates for term proposals and sense disambiguation.
- Versions bumped to 0.2.0; changelog dated; v0.1.5 marked superseded.
- Local dev, releasing, backups, runbooks, taxonomy, editorial layer,
  API, and licensing docs rewritten; prose follows the unslop rules.
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
synac-web Error Error Sep 11, 2026 2:28am UTC

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Too many files changed for review (370 files, 200 file limit).

Bypass the limit by tagging @greptile-apps to review.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 370

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2a17b14d-f92b-46f6-bf2f-1f58909c6e3b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

A global gitignore rule named `tags` excluded these files from the earlier
commit; force-added so the build has the routes it imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant