Module: Textus::Layout

Defined in:
lib/textus/layout.rb

Overview

Single source of truth for every path textus owns under a store root. All disposable runtime state nests under <root>/.run/ so the tracked/disposable boundary is a directory boundary. ADR 0038.

Constant Summary collapse

RUN =
".run"
DATA =
"data"
GITIGNORE =

Back-compat constant: the no-untracked-entries body (just the run subtree).

gitignore_body

Class Method Summary collapse

Class Method Details

.audit_dir(root) ⇒ Object



49
50
51
# File 'lib/textus/layout.rb', line 49

def self.audit_dir(root)
  File.join(run(root), "audit")
end

.audit_log(root) ⇒ Object



61
62
63
# File 'lib/textus/layout.rb', line 61

def self.audit_log(root)
  File.join(audit_dir(root), "audit.log")
end

.build_lock(root) ⇒ Object



33
34
35
# File 'lib/textus/layout.rb', line 33

def self.build_lock(root)
  File.join(run(root), "build.lock")
end

.cursor(root, role) ⇒ Object



25
26
27
# File 'lib/textus/layout.rb', line 25

def self.cursor(root, role)
  File.join(state(root), "cursor.#{role}")
end

.data(root) ⇒ Object



9
10
11
# File 'lib/textus/layout.rb', line 9

def self.data(root)
  File.join(root, DATA)
end

.data_lane(root, lane_name) ⇒ Object



13
14
15
# File 'lib/textus/layout.rb', line 13

def self.data_lane(root, lane_name)
  File.join(data(root), lane_name)
end

.gitignore_body(untracked_paths: []) ⇒ Object

The store’s ‘.gitignore` body. Always ignores the runtime subtree (`.run/`, ADR 0038); when given untracked entry paths (entries marked `tracked: false`), it also lists those so they stay protocol-readable but uncommitted (ADR 0043, refining 0038). Generated, never hand-kept — no drift between the manifest and the ignore file.



70
71
72
73
74
75
76
77
78
# File 'lib/textus/layout.rb', line 70

def self.gitignore_body(untracked_paths: [])
  lines = ["# textus runtime artifacts — safe to delete, never commit",
           "#{RUN}/"]
  unless untracked_paths.empty?
    lines << "# tracked:false entries — protocol-readable, not committed (sensitive)"
    lines.concat(untracked_paths)
  end
  "#{lines.join("\n")}\n"
end

.locks(root) ⇒ Object



29
30
31
# File 'lib/textus/layout.rb', line 29

def self.locks(root)
  File.join(run(root), "locks")
end

.queue(root) ⇒ Object



41
42
43
# File 'lib/textus/layout.rb', line 41

def self.queue(root)
  File.join(run(root), "queue")
end

.queue_state(root, state) ⇒ Object



45
46
47
# File 'lib/textus/layout.rb', line 45

def self.queue_state(root, state)
  File.join(queue(root), state.to_s)
end

.run(root) ⇒ Object



17
18
19
# File 'lib/textus/layout.rb', line 17

def self.run(root)
  File.join(root, RUN)
end

.sentinels(root) ⇒ Object

Sentinels are machine-generated (the published target’s sha), not authored source, so they live on the runtime side under ‘.run/` — git-ignored, regenerated by the next build via content-identical adoption (ADR 0070, superseding ADR 0038’s ‘:config` classification).



57
58
59
# File 'lib/textus/layout.rb', line 57

def self.sentinels(root)
  File.join(run(root), "sentinels")
end

.state(root) ⇒ Object



21
22
23
# File 'lib/textus/layout.rb', line 21

def self.state(root)
  File.join(run(root), "state")
end

.watcher_lock(root) ⇒ Object



37
38
39
# File 'lib/textus/layout.rb', line 37

def self.watcher_lock(root)
  File.join(run(root), "watcher.lock")
end