'
98 FOOT = ('INTERPLANE Forge: agents express intent; the forge retains authority. %s'
99 " served by forged, a seeded-Omega web server, with no JavaScript.
")
100 FOOT_A = FOOT % "Built on Radicle (Heartwood): repositories are Radicle projects"
101 FOOT_A2 = FOOT % "Repositories are" # the footer after the Radicle-text removal (`c1f107df`)
102 FOOT_B = FOOT % "Repositories are plain Git kept in Interplane's own signed store,"
103 PATCH = "Patch A proposed change, %s The list is under "
104 PATCH_A = PATCH % "sent over Radicle and reviewed before it is merged."
105 PATCH_B = PATCH % "reviewed before it is merged. This forge does not show proposed changes from its own store yet."
106 PANEL = 'Get this repository
'
107 PANEL_A = re.compile(PANEL + "- Radicle
- " + CODE + "rad clone rad:" + RIDF + "
"
108 "(- Git over HTTPS
- " + CODE + r"git clone )https://www\.aienos\.com/rad/\1\.git"
109 "(
- Source archive of .*)", re.S)
110 OBJECT_A = re.compile(r'"clone":\{"rad":"rad:(z[0-9A-Za-z]+)","rad_clone":"rad clone rad:\1",'
111 r'"git_https":"https://www\.aienos\.com/rad/\1\.git"(.*)', re.S)
112 STORE_GIT = "https://interplane.io/projects/%s/repo.git"
113 DEV_RID = re.compile(r"
- RID
- The Radicle ID: the project's permanent name on Radicle, the open network"
114 r" that stores and signs it\. This one is " + CODE + "rad:" + RIDF + r"\.
")
115 DEV_DELEGATE = re.compile(r"- Delegate
- A key that may sign the project's official versions\. This forge"
116 r" lists the project under ([^;<]+); " + CODE + "rad inspect rad:" + RIDF +
117 r" --delegates prints the project's own list\.
")
118 DEV_SEED = ("- Seed
- A Radicle node that keeps a copy of the project and serves it to others. The count"
119 " below is read from this node's routing table.
")
120 DEV_ID = (r"- ID
- The project's permanent id on Interplane: the SHA-256 of its first signed record\."
121 " This one is " + CODE + r'git:([0-9a-f]{64})\. Its old Radicle ID,'
122 " kept only so that old links still work: " + CODE + r"rad:%s\.
")
123 DEV_OWNER = (r"- Owner
- The key that signs every record of the project\. This forge lists the project"
124 " under %s; its key is " + CODE + r"(SHA256:[A-Za-z0-9+/]{43})\.
")
125
126
127 def project(path):
128 f = path.split("?")[0].split("/")
129 n = f[2] if len(f) > 2 else ""
130 return n[:-5] if len(f) == 3 and n.endswith(".json") else n
131
132
133 def r_ids(a, b, name):
134 # the same line with a Radicle id where STORE has the store id; ids equal on both sides stay as they are
135 if IDS.split(a[0]) != IDS.split(b[0]):
136 return None
137 d = [(x, y) for x, y in zip(IDS.findall(a[0]), IDS.findall(b[0])) if x != y]
138 if not d or not all(x.startswith(("rad:", "z")) and y.startswith("git:") for x, y in d):
139 return None
140 # a bare old id (MAIN after `c1f107df`) is the same id as rad:: one name for the one-to-one check
141 return [("id", x if x.startswith("rad:") else "rad:" + x, y) for x, y in d]
142
143
144 def r_nav(a, b, name):
145 return [] if SEAM in a[0] and '