~bigbes/sr-ht-spec · parade

main · last commit 18 hours ago · 8tmadfpi

← Back to the parade

spec-arv Add a layering guard test to specs (core, db/authn, service, api/web) Lined Up

status: open P2 task
bd update spec-arv --claim bd close spec-arv
Created byEugene Blikh
Ownerbigbes@gmail.com
Created2026-08-17T20:40:08Z
Updated2026-08-17T20:40:08Z
Description
What is wrong: specs declares the `core ← db/authn ← service ← api/web` layering invariant in prose (its `CLAUDE.md`/`SPEC.md`) but has no test that machine-checks it — unlike two siblings.

Why it matters: the invariant is what makes `service/` the single place a security check can be located. A prose invariant that nothing checks is the one that quietly stops holding, especially once several agents/contributors are editing the codebase in parallel.

Sibling that does it correctly: `sourcehut-bench/api/layering_test.go` and the equivalent in `sourcehut-artifacts`, both of which machine-check the invariant including the three known bypasses ("api,service: close the three ways round the layering guard").

Fix: copy `api/layering_test.go` into specs, adjusting package names and import paths for specs' own directory layout.

Note: confidence reported (not independently re-verified in this pass).

Audit: D18 (cross-repo audit, 2026-08-17)

Depends on

No outgoing dependencies.

Depended on by

Nothing depends on this issue.

No comments.

  • Eugene Blikh created the issue · 2026-08-17T23:40:07Z
Stored rows — what this pane was built from, as read
issues 1 row
id spec-arv
content_hash 65610c98c0d503b154f7a7a217cce31eea541aec1653fd33523da8afcf093d2d
title Add a layering guard test to specs (core, db/authn, service, api/web)
description What is wrong: specs declares the `core ← db/authn ← service ← api/web` layering invariant in prose (its `CLAUDE.md`/`SPEC.md`) but has no test that machine-checks it — unlike two siblings. Why it matters: the invariant is what makes `service/` the single place a security check can be located. A prose invariant that nothing checks is the one that quietly stops holding, especially once several agents/contributors are editing the codebase in parallel. Sibling that does it correctly: `sourcehut-bench/api/layering_test.go` and the equivalent in `sourcehut-artifacts`, both of which machine-check the invariant including the three known bypasses ("api,service: close the three ways round the layering guard"). Fix: copy `api/layering_test.go` into specs, adjusting package names and import paths for specs' own directory layout. Note: confidence reported (not independently re-verified in this pass). Audit: D18 (cross-repo audit, 2026-08-17)
design
acceptance_criteria
notes
status open
priority 2
issue_type task
assignee NULL
estimated_minutes NULL
created_at 2026-08-17T20:40:08Z
created_by Eugene Blikh
owner bigbes@gmail.com
updated_at 2026-08-17T20:40:08Z
closed_at NULL
closed_by_session
external_ref NULL
spec_id
compaction_level 0
compacted_at NULL
compacted_at_commit NULL
original_size NULL
sender
ephemeral 0
wisp_type
pinned 0
is_template 0
mol_type
work_type
source_system
metadata �{}
source_repo
close_reason
event_kind
actor
target
payload
await_type
await_id
timeout_ns 0
waiters
hook_bead
role_bead
agent_state
last_activity NULL
role_type
rig
due_at NULL
defer_until NULL
no_history 0
started_at NULL
is_blocked 0
events 1 row
id 01a01173-f7b4-7c73-b603-864a02bc2943
issue_id spec-arv
event_type created
actor Eugene Blikh
old_value
new_value
comment NULL
created_at 2026-08-17T23:40:07Z