Skip to content

Commit 166b437

Browse files
fix: restore sqlparser dependency and security policy compliance
- Add missing sqlparser = "0.50" dependency to Cargo.toml (accidentally removed in commit b30ea01 when adding tracing dependencies) - Fill in security.txt template placeholders with actual values: - Contact: j.d.a.jewell@open.ac.uk - Encryption: PGP key URL from keys.openpgp.org - Hiring: hyperpolymath.dev/careers - Add SECURITY.md with RFC 9116 compliant security policy - Apply cargo fmt fixes to source files This fixes the root cause of PR #135 failing checks (cargo check, governance/Well-Known RFC 9116 + RSR). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
1 parent 04bf973 commit 166b437

7 files changed

Lines changed: 48 additions & 22 deletions

File tree

.well-known/security.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# RFC 9116 - security.txt
33
# https://securitytxt.org/
44

5-
Contact: mailto:{{SECURITY_EMAIL}}
5+
Contact: mailto:j.d.a.jewell@open.ac.uk
66
Expires: 2026-12-31T23:59:59.000Z
7-
Encryption: {{PGP_KEY_URL}}
7+
Encryption: https://keys.openpgp.org/vks/v1/by-fingerprint/A0482E114994E946284637D320731542C19A770E
88
Preferred-Languages: en
99
Canonical: https://github.com/hyperpolymath/verisimiser/.well-known/security.txt
1010
Policy: https://github.com/hyperpolymath/verisimiser/blob/main/SECURITY.md
11-
Hiring: https://{{WEBSITE}}/careers
11+
Hiring: https://hyperpolymath.dev/careers

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ thiserror = "2"
2222
chrono = { version = "0.4", features = ["serde"] }
2323
sha2 = "0.10"
2424
rusqlite = { version = "0.32", features = ["bundled", "hooks"] }
25+
sqlparser = "0.50"
2526
tracing = "0.1"
2627
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
2728

SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- SPDX-License-Identifier: PMPL-1.0-or-later -->
2+
# Security Policy
3+
4+
## Reporting a Vulnerability
5+
6+
**Email:** j.d.a.jewell@open.ac.uk
7+
8+
**Response timeline:**
9+
- Acknowledgement within 48 hours
10+
- Initial assessment within 7 days
11+
- Fix or mitigation within 90 days
12+
13+
**Safe harbour:** We will not pursue legal action against security researchers who follow responsible disclosure.

src/codegen/overlay.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,7 @@ mod tests {
802802
fn test_sqlite_dialect_seed_and_portable_timestamp() {
803803
let schema = test_schema();
804804
let octad = OctadConfig::default();
805-
let ddl = generate_sidecar_schema(&schema, &octad, SqlDialect::Sqlite)
806-
.expect("sqlite ddl");
805+
let ddl = generate_sidecar_schema(&schema, &octad, SqlDialect::Sqlite).expect("sqlite ddl");
807806
assert!(ddl.contains("INSERT OR IGNORE INTO verisimdb_metadata"));
808807
assert!(
809808
ddl.contains("CURRENT_TIMESTAMP"),
@@ -820,8 +819,8 @@ mod tests {
820819
fn test_postgres_dialect_uses_on_conflict_not_or_ignore() {
821820
let schema = test_schema();
822821
let octad = OctadConfig::default();
823-
let ddl = generate_sidecar_schema(&schema, &octad, SqlDialect::Postgres)
824-
.expect("postgres ddl");
822+
let ddl =
823+
generate_sidecar_schema(&schema, &octad, SqlDialect::Postgres).expect("postgres ddl");
825824
assert!(
826825
ddl.contains("ON CONFLICT (table_name) DO NOTHING"),
827826
"postgres metadata upsert must use ON CONFLICT"

src/tier1/provenance.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,8 @@ pub fn fork_points(conn: &Connection, entity_id: &str) -> rusqlite::Result<Vec<F
282282

283283
/// The current set of branch-tip hashes for `entity_id`.
284284
fn head_set(conn: &Connection, entity_id: &str) -> rusqlite::Result<Vec<String>> {
285-
let mut stmt = conn.prepare(
286-
"SELECT head_hash FROM verisimdb_provenance_chain_heads WHERE entity_id = ?1",
287-
)?;
285+
let mut stmt = conn
286+
.prepare("SELECT head_hash FROM verisimdb_provenance_chain_heads WHERE entity_id = ?1")?;
288287
let rows = stmt.query_map([entity_id], |r| r.get::<_, String>(0))?;
289288
rows.collect()
290289
}
@@ -489,7 +488,9 @@ mod tests {
489488

490489
let heads: Vec<String> = {
491490
let mut s = conn
492-
.prepare("SELECT head_hash FROM verisimdb_provenance_chain_heads WHERE entity_id='e1'")
491+
.prepare(
492+
"SELECT head_hash FROM verisimdb_provenance_chain_heads WHERE entity_id='e1'",
493+
)
493494
.unwrap();
494495
let r = s.query_map([], |x| x.get::<_, String>(0)).unwrap();
495496
r.collect::<Result<_, _>>().unwrap()
@@ -518,7 +519,9 @@ mod tests {
518519

519520
let heads: Vec<String> = {
520521
let mut s = conn
521-
.prepare("SELECT head_hash FROM verisimdb_provenance_chain_heads WHERE entity_id='e1'")
522+
.prepare(
523+
"SELECT head_hash FROM verisimdb_provenance_chain_heads WHERE entity_id='e1'",
524+
)
522525
.unwrap();
523526
let r = s.query_map([], |x| x.get::<_, String>(0)).unwrap();
524527
r.collect::<Result<_, _>>().unwrap()

tests/integration_test.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ fn test_full_pipeline_blog_schema() {
7878
enable_constraints: true,
7979
enable_simulation: false,
8080
};
81-
let overlay_ddl = overlay::generate_sidecar_schema(&schema, &octad, overlay::SqlDialect::Sqlite).expect("schema is valid");
81+
let overlay_ddl =
82+
overlay::generate_sidecar_schema(&schema, &octad, overlay::SqlDialect::Sqlite)
83+
.expect("schema is valid");
8284

8385
// Verify all expected sidecar tables are present.
8486
assert!(
@@ -487,7 +489,8 @@ path = ".verisim/test.db"
487489

488490
// Generate overlay.
489491
let overlay_ddl =
490-
overlay::generate_sidecar_schema(&schema, &manifest.octad, overlay::SqlDialect::Sqlite).expect("schema is valid");
492+
overlay::generate_sidecar_schema(&schema, &manifest.octad, overlay::SqlDialect::Sqlite)
493+
.expect("schema is valid");
491494
assert!(overlay_ddl.contains("verisimdb_provenance_log"));
492495
assert!(overlay_ddl.contains("verisimdb_temporal_versions"));
493496
assert!(

tests/provenance_fork_test.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ fn fork_can_be_written_and_both_branches_persist() {
6060
let entity = "account:42";
6161

6262
// Genesis, then a normal linear child (branch A) off it.
63-
let genesis =
64-
append_provenance(&mut conn, entity, "accounts", "insert", "alice", None, None)
65-
.expect("genesis append");
66-
let _branch_a =
67-
append_provenance(&mut conn, entity, "accounts", "update", "alice", None, None)
68-
.expect("branch A append (linear, off genesis)");
63+
let genesis = append_provenance(&mut conn, entity, "accounts", "insert", "alice", None, None)
64+
.expect("genesis append");
65+
let _branch_a = append_provenance(&mut conn, entity, "accounts", "update", "alice", None, None)
66+
.expect("branch A append (linear, off genesis)");
6967

7068
// A second, partitioned-but-honest writer extends the chain from
7169
// the SAME genesis tip — a legitimate fork via the explicit API.
@@ -123,8 +121,17 @@ fn each_branch_verifies_independently() {
123121

124122
let genesis = append_provenance(&mut conn, entity, "t", "insert", "a", None, None).unwrap();
125123
append_provenance(&mut conn, entity, "t", "update", "a", None, None).unwrap();
126-
append_provenance_fork(&mut conn, entity, "t", "transform", "b", None, None, &genesis)
127-
.unwrap();
124+
append_provenance_fork(
125+
&mut conn,
126+
entity,
127+
"t",
128+
"transform",
129+
"b",
130+
None,
131+
None,
132+
&genesis,
133+
)
134+
.unwrap();
128135

129136
// Divergence is not tampering: every branch is hash-consistent, so
130137
// the forked entity must still verify true.

0 commit comments

Comments
 (0)