@terpjs/spec 0.16.0 → 0.18.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/VERSION +1 -1
- package/catalog/backend/migration_history_is_intact.json +22 -0
- package/catalog/backend/no_hardcoded_credentials.json +1 -1
- package/corpus/backend/migration_history_is_intact/compliant-01/modules/notes/migrations/versions/0001_base.py +10 -0
- package/corpus/backend/migration_history_is_intact/compliant-01/modules/notes/migrations/versions/0002_change.py +10 -0
- package/corpus/backend/migration_history_is_intact/violation-01/modules/notes/migrations/versions/0001_base.py +10 -0
- package/corpus/backend/migration_history_is_intact/violation-01/modules/notes/migrations/versions/0002_change.py +10 -0
- package/corpus/backend/migration_history_is_intact/violation-02/modules/notes/migrations/versions/0001_cycle.py +10 -0
- package/corpus/backend/migration_history_is_intact/violation-02/modules/notes/migrations/versions/0002_cycle.py +10 -0
- package/corpus/backend/no_hardcoded_credentials/compliant-03/modules/billing/schemas.py +20 -0
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.18.0
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "backend/migration_history_is_intact",
|
|
3
|
+
"surface": "backend",
|
|
4
|
+
"title": "Each migration history is one unbroken chain from a single first revision",
|
|
5
|
+
"intent": "A revision whose parent is missing, or a second revision claiming to start the history, means an already-authored migration was deleted or replaced rather than built upon. Every database that applied the removed revision then becomes unupgradable, and no schema-drift check can see it: a database rebuilt from the rewritten history is perfectly consistent with the models, so the build stays green while every provisioned environment is stranded. New schema changes are added on top of the existing chain.",
|
|
6
|
+
"layer": "static-portable",
|
|
7
|
+
"enforcement": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "build-time",
|
|
10
|
+
"tool": "terp.arch",
|
|
11
|
+
"ref": "check_migration_history_is_intact"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"reference": "Within each non-empty migrations/versions directory, exactly one revision must declare no parent; every other revision's declared parent (one id, or each id of a merge revision's tuple) must name a revision defined in that same directory, and every revision must be reachable from that first revision (no cycles or disconnected chains).",
|
|
15
|
+
"opt_out": "# arch-allow-migration-history-is-intact: <reason>",
|
|
16
|
+
"runtime": {
|
|
17
|
+
"applicability": "not-applicable",
|
|
18
|
+
"rationale": "Chain integrity is a property of the authored revision files and is checked from source alone. The complementary runtime control (terp.migrations.assert_no_orphaned_revisions, which refuses a database whose applied revisions the code no longer defines) enforces a different invariant on a different input: it needs a live database and cannot be observed from the source tree."
|
|
19
|
+
},
|
|
20
|
+
"guide_topic": "migrations",
|
|
21
|
+
"corpus": true
|
|
22
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "backend/no_hardcoded_credentials",
|
|
3
3
|
"surface": "backend",
|
|
4
4
|
"title": "App modules do not hard-code credentials or recognizable secret tokens",
|
|
5
|
-
"intent": "A credential-shaped assignment to a non-empty string literal is almost always a secret that should come from sealed config / environment wiring, not source. The rule also rejects common high-confidence secret literal formats anywhere in a module so leaked keys are caught even when assigned to a bland variable name. As a security rule this also scans test and migration files inside a module — a real secret is a leak wherever it is committed.",
|
|
5
|
+
"intent": "A credential-shaped assignment to a non-empty string literal is almost always a secret that should come from sealed config / environment wiring, not source. The rule also rejects common high-confidence secret literal formats anywhere in a module so leaked keys are caught even when assigned to a bland variable name. As a security rule this also scans test and migration files inside a module — a real secret is a leak wherever it is committed. One shape is exempt: an enum member whose literal is its own name (SECRET_REFERENCE = \"secret_reference\") is vocabulary, not secret material.",
|
|
6
6
|
"layer": "static-portable",
|
|
7
7
|
"enforcement": [
|
|
8
8
|
{
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Compliant: enum vocabulary whose literal is the member's own name.
|
|
2
|
+
|
|
3
|
+
A member like ``SECRET_REFERENCE = "secret_reference"`` names a parameter kind —
|
|
4
|
+
the string carries no secret material, it *is* the identifier's wire spelling.
|
|
5
|
+
Flagging it would push authors to spell the same vocabulary as ``auto()`` purely
|
|
6
|
+
to dodge the rule, hiding the wire value from readers of the schema.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from enum import StrEnum
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ParameterType(StrEnum):
|
|
13
|
+
TEXT = "text"
|
|
14
|
+
NUMBER = "number"
|
|
15
|
+
SECRET_REFERENCE = "secret_reference"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class TokenKind(StrEnum):
|
|
19
|
+
ACCESS_TOKEN = "access_token"
|
|
20
|
+
REFRESH_TOKEN = "refresh_token"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terpjs/spec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "The Terp Standard — stack-neutral rule catalog, violation corpus, finding format, and refused-surface declaration (ADRs 0080/0081; packaged per ADR 0082, published per ADR 0086). Data only: consumers resolve the spec root via require.resolve('@terpjs/spec/package.json').",
|
|
5
5
|
"files": [
|
|
6
6
|
"VERSION",
|