Skip to content

Commit aaefbac

Browse files
committed
Phase 1 - Fresh Chat - Complete
1 parent 7930af6 commit aaefbac

17 files changed

Lines changed: 271 additions & 6 deletions
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"rule_set_id": "argus-address-v1",
3+
"fanout": {
4+
"algorithm": "sha256-prefix",
5+
"prefix_hex_chars": 2
6+
},
7+
"anchor": "ADDRESS_RULES_READY"
8+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "CanonicalMeta",
4+
"type": "object",
5+
"required": [
6+
"source_path",
7+
"source_sha256",
8+
"canonical_path",
9+
"canonical_fanout",
10+
"provenance_parent",
11+
"addressing_rule_set",
12+
"canonicalization_anchor",
13+
"provenance_anchor"
14+
],
15+
"properties": {
16+
"source_path": { "type": "string" },
17+
"source_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
18+
"canonical_path": { "type": "string" },
19+
"canonical_fanout": { "type": "string", "pattern": "^[a-f0-9]{2}$" },
20+
"provenance_parent": { "type": "string" },
21+
"addressing_rule_set": { "type": "string" },
22+
"canonicalization_anchor": { "const": "CANONICALIZATION_READY" },
23+
"provenance_anchor": { "const": "PROVENANCE_CHAIN_READY" }
24+
},
25+
"additionalProperties": false
26+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string]$RegistrationPath,
4+
[Parameter(Mandatory=$true)]
5+
[string]$CanonicalRoot,
6+
[string]$AddressingRulesPath,
7+
[string]$CanonicalMetaOut
8+
)
9+
10+
if (-not$AddressingRulesPath) {
11+
$AddressingRulesPath=Join-Path$PSScriptRoot'addressing_rules.json'
12+
}
13+
14+
$registration=Get-Content-LiteralPath $RegistrationPath-Raw |ConvertFrom-Json
15+
$rules=Get-Content-LiteralPath $AddressingRulesPath-Raw |ConvertFrom-Json
16+
17+
if (-not$CanonicalMetaOut) {
18+
$CanonicalMetaOut=Join-Path$CanonicalRoot'canonical_meta.json'
19+
}
20+
21+
$sha=$registration.source_sha256.ToLowerInvariant()
22+
$fanout=$sha.Substring(0,2)
23+
$canonicalDir=Join-Path$CanonicalRoot$fanout
24+
New-Item-ItemType Directory -Force -Path $canonicalDir|Out-Null
25+
26+
$canonicalPath=Join-Path$canonicalDir ("$sha.txt")
27+
Copy-Item-LiteralPath $registration.source_path-Destination $canonicalPath-Force
28+
29+
$meta= [ordered]@{
30+
source_path=$registration.source_path
31+
source_sha256=$sha
32+
canonical_path= (Resolve-Path-LiteralPath $canonicalPath).Path
33+
canonical_fanout=$fanout
34+
provenance_parent= (Resolve-Path-LiteralPath $RegistrationPath).Path
35+
addressing_rule_set=$rules.rule_set_id
36+
canonicalization_anchor='CANONICALIZATION_READY'
37+
provenance_anchor='PROVENANCE_CHAIN_READY'
38+
}
39+
40+
$metaDir=Split-Path-Parent $CanonicalMetaOut
41+
if ($metaDir) {
42+
New-Item-ItemType Directory -Force -Path $metaDir|Out-Null
43+
}
44+
$meta|ConvertTo-Json-Depth 8|Set-Content-LiteralPath $CanonicalMetaOut-Encoding utf8
45+
46+
Write-Output"CANONICALIZATION_READY"
47+
Write-Output"PROVENANCE_CHAIN_READY"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
param(
2+
[Parameter(Mandatory=$true)]
3+
[string]$InputPath,
4+
[Parameter(Mandatory=$true)]
5+
[string]$RegistrationOut,
6+
[string]$SupportedTypesPath
7+
)
8+
9+
if (-not$SupportedTypesPath) {
10+
$SupportedTypesPath=Join-Path$PSScriptRoot'supported_types.json'
11+
}
12+
13+
$inputFile=Get-Item-LiteralPath $InputPath-ErrorAction Stop
14+
$supported=Get-Content-LiteralPath $SupportedTypesPath-Raw |ConvertFrom-Json
15+
$ext=$inputFile.Extension.ToLowerInvariant()
16+
17+
if ($supported.extensions-notcontains$ext) {
18+
Write-Output"UNSUPPORTED_TYPE_REJECTED"
19+
throw"Unsupported file type: $ext"
20+
}
21+
22+
$hash= (Get-FileHash-Algorithm SHA256 -LiteralPath $inputFile.FullName).Hash.ToLowerInvariant()
23+
$registration= [ordered]@{
24+
source_path=$inputFile.FullName
25+
source_name=$inputFile.Name
26+
extension=$ext
27+
source_sha256=$hash
28+
registered_utc= [DateTime]::UtcNow.ToString('o')
29+
registration_anchor='INTAKE_REGISTRATION_READY'
30+
}
31+
32+
$registrationDir=Split-Path-Parent $RegistrationOut
33+
if ($registrationDir) {
34+
New-Item-ItemType Directory -Force -Path $registrationDir|Out-Null
35+
}
36+
37+
$registration|ConvertTo-Json-Depth 8|Set-Content-LiteralPath $RegistrationOut-Encoding utf8
38+
Write-Output"INTAKE_REGISTRATION_READY"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "SourceRegistration",
4+
"type": "object",
5+
"required": [
6+
"source_path",
7+
"source_name",
8+
"extension",
9+
"source_sha256",
10+
"registered_utc",
11+
"registration_anchor"
12+
],
13+
"properties": {
14+
"source_path": { "type": "string" },
15+
"source_name": { "type": "string" },
16+
"extension": { "type": "string" },
17+
"source_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
18+
"registered_utc": { "type": "string", "format": "date-time" },
19+
"registration_anchor": { "const": "INTAKE_REGISTRATION_READY" }
20+
},
21+
"additionalProperties": false
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extensions": [
3+
".md",
4+
".txt",
5+
".json"
6+
]
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$projectRoot= (Resolve-Path (Join-Path$PSScriptRoot'..\..')).Path
2+
$sampleDir=Join-Path$projectRoot'05_NUMBERS/test_outputs/samples'
3+
$canonicalRoot=Join-Path$projectRoot'05_NUMBERS/test_outputs/canonical'
4+
$logPath=Join-Path$projectRoot'05_NUMBERS/test_outputs/canonicalization_smoke.log'
5+
6+
New-Item-ItemType Directory -Force -Path $sampleDir,$canonicalRoot|Out-Null
7+
"phase1 canonical sample"|Set-Content-Path (Join-Path$sampleDir'canonical_sample.md') -Encoding utf8
8+
9+
$registrationOut=Join-Path$sampleDir'canonical_registration.json'
10+
$registerScript=Join-Path$projectRoot'02_EXODUS/runtime/intake/register_sources.ps1'
11+
& powershell -ExecutionPolicy Bypass -File $registerScript-InputPath (Join-Path$sampleDir'canonical_sample.md') -RegistrationOut $registrationOut|Out-Null
12+
if ($LASTEXITCODE-ne0) { throw'register_sources failed in canonicalization smoke' }
13+
14+
$canonicalMetaOut=Join-Path$sampleDir'canonical_meta.json'
15+
$canonicalScript=Join-Path$projectRoot'02_EXODUS/runtime/canonicalize/canonicalize_sources.ps1'
16+
$output=& powershell -ExecutionPolicy Bypass -File $canonicalScript-RegistrationPath $registrationOut-CanonicalRoot $canonicalRoot-CanonicalMetaOut $canonicalMetaOut
17+
$output|Set-Content-Path $logPath-Encoding utf8
18+
19+
if ($LASTEXITCODE-ne0) { throw'canonicalize_sources failed' }
20+
if (-not ($output-match'CANONICALIZATION_READY')) { throw'CANONICALIZATION_READY missing' }
21+
if (-not ($output-match'PROVENANCE_CHAIN_READY')) { throw'PROVENANCE_CHAIN_READY missing' }
22+
23+
Write-Output'CANONICALIZATION_READY'
24+
Write-Output'PROVENANCE_CHAIN_READY'

‎02_EXODUS/tests/intake_smoke.ps1‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$projectRoot= (Resolve-Path (Join-Path$PSScriptRoot'..\..')).Path
2+
$sampleDir=Join-Path$projectRoot'05_NUMBERS/test_outputs/samples'
3+
$logPath=Join-Path$projectRoot'05_NUMBERS/test_outputs/intake_smoke.log'
4+
5+
New-Item-ItemType Directory -Force -Path $sampleDir|Out-Null
6+
"phase1 intake sample"|Set-Content-Path (Join-Path$sampleDir'sample.md') -Encoding utf8
7+
8+
$registrationOut=Join-Path$sampleDir'source_registration.json'
9+
$scriptPath=Join-Path$projectRoot'02_EXODUS/runtime/intake/register_sources.ps1'
10+
11+
$output=& powershell -ExecutionPolicy Bypass -File $scriptPath-InputPath (Join-Path$sampleDir'sample.md') -RegistrationOut $registrationOut
12+
$output|Set-Content-Path $logPath-Encoding utf8
13+
14+
if ($LASTEXITCODE-ne0) { throw'register_sources failed' }
15+
if (-not ($output-match'INTAKE_REGISTRATION_READY')) { throw'INTAKE_REGISTRATION_READY missing' }
16+
17+
Write-Output'INTAKE_REGISTRATION_READY'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**Roadmap Version**
2+
v1
3+
4+
**Phase Identifier**
5+
1
6+
7+
**Phase Title**
8+
Intake And Canonicalization Foundation
9+
10+
**Phase Type**
11+
implementation
12+
13+
**Receipt Status**
14+
PASS
15+
16+
**Realization Mode**
17+
create
18+
19+
**Validated By**
20+
/record_phase_completion
21+
22+
**Verified Exit Criteria**
23+
- File exists at `02_EXODUS/runtime/intake/register_sources.ps1`.
24+
- File exists at `02_EXODUS/runtime/intake/source_registration.schema.json`.
25+
- File exists at `02_EXODUS/runtime/canonicalize/canonicalize_sources.ps1`.
26+
- File exists at `02_EXODUS/runtime/canonicalize/canonical_meta.schema.json`.
27+
-`02_EXODUS/runtime/intake/register_sources.ps1` contains the exact anchor string: "INTAKE_REGISTRATION_READY".
28+
-`02_EXODUS/runtime/intake/register_sources.ps1` contains the exact anchor string: "UNSUPPORTED_TYPE_REJECTED".
29+
-`02_EXODUS/runtime/canonicalize/canonicalize_sources.ps1` contains the exact anchor string: "CANONICALIZATION_READY".
30+
-`02_EXODUS/runtime/canonicalize/canonicalize_sources.ps1` contains the exact anchor string: "PROVENANCE_CHAIN_READY".
31+
-`02_EXODUS/runtime/canonicalize/addressing_rules.json` contains the exact anchor string: "ADDRESS_RULES_READY".
32+
- Command "powershell -ExecutionPolicy Bypass -File 02_EXODUS/tests/intake_smoke.ps1" exits with code 0 and emits "INTAKE_REGISTRATION_READY" in `05_NUMBERS/test_outputs/intake_smoke.log`.
33+
- Command "powershell -ExecutionPolicy Bypass -File 02_EXODUS/tests/canonicalization_smoke.ps1" exits with code 0 and emits "CANONICALIZATION_READY" in `05_NUMBERS/test_outputs/canonicalization_smoke.log`.
34+
- Command "powershell -ExecutionPolicy Bypass -File 02_EXODUS/tests/canonicalization_smoke.ps1" exits with code 0 and emits "PROVENANCE_CHAIN_READY" in `05_NUMBERS/test_outputs/canonicalization_smoke.log`.

‎03_LEVITICUS/STATE_SUMMARY.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
**Active Phase**
2-
1
1+
**Active Phase**
2+
2
33

44
**Roadmap Version**
55
v1
66

77
**Completed Phases**
8+
- 1
89

910
**Current Work Artifact**
10-
02_EXODUS/runtime/intake/register_sources.ps1
11+
02_EXODUS/runtime/extract/extract_statements.ps1
1112

1213
**Open Risks**
13-
-`SCHEMA_VIOLATION` risk until `03_LEVITICUS/STATE_SUMMARY.md` is re-established from the active roadmap.
14-
- Phase 1 required runtime artifacts are absent under `02_EXODUS/runtime/`.
14+
- Phase 2 required runtime artifacts are absent under `02_EXODUS/runtime/extract/` and `02_EXODUS/runtime/trace/`.
1515

1616
**Deferred Registry**
1717

1818
**Next Deterministic Objective**
19-
Create `02_EXODUS/runtime/intake/register_sources.ps1` so the first unmet Phase 1 Exit Criterion evaluates TRUE.
19+
Create `02_EXODUS/runtime/extract/extract_statements.ps1` so the first unmet Phase 2 Exit Criterion evaluates TRUE.

0 commit comments

Comments
 (0)