mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-10-02 04:43:58 +00:00
docs: OpenStack.md 0.1, one Markdown file for what a project is built on
A new LogicSRC spec in the catalogs family. One heading, an identity block (Kind, Web, Repo, Operator, License, Extends, Updated), one line, then eleven layers: Languages, Runtimes, Interfaces (one ### per way in: web, api, cli, tui, mcp, desktop, mobile, worker, extension, bot), Data, Services, Modules, Tooling, Hosting, Auth, Conventions, Not. An item is one bullet: name, version, an optional status word (trial, hold, leaving) and a role. Extends inherits a parent file, sections replace, Conventions and Not accumulate. Rule 8 is the reading rule for agents: use what is listed, prefer listed over new, ask before adding a layer or a service, never add a Not, keep the file true. Discovery at OpenStack.md in the repo, /.well-known/openstack.md, rel=openstack, or a platform path. JSON is derived and never the source. logicsrc.com serves its own at /.well-known/openstack.md: the route extracts the worked example from docs/openstack.md, and a contract test holds the two together and checks the file follows its own rules. rel=openstack in <head> and in the Link header beside openprofile. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
08490aecf3
commit
fc9014e8b2
8 changed files with 684 additions and 4 deletions
43
apps/logicsrc-web/contract/openstack.contract.test.ts
Normal file
43
apps/logicsrc-web/contract/openstack.contract.test.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { GET, openstackBody } from "../src/app/.well-known/openstack.md/route";
|
||||
import { readDoc } from "../src/lib/docs";
|
||||
|
||||
// The site that publishes a spec serves its own file, and that file is the
|
||||
// worked example inside the spec, so the two can never drift apart.
|
||||
describe("OpenStack.md: the site's own file", () => {
|
||||
it("serves the spec's worked example as text/markdown", async () => {
|
||||
const res = GET();
|
||||
expect(res.headers.get("content-type")).toBe("text/markdown; charset=utf-8");
|
||||
const body = await res.text();
|
||||
expect(body.startsWith("# LogicSRC\n")).toBe(true);
|
||||
expect(readDoc("openstack")).toContain(body.trim());
|
||||
});
|
||||
|
||||
it("follows its own rules: one name, an identity block, the fixed layers, a Not section", () => {
|
||||
const body = openstackBody();
|
||||
expect(body.match(/^# /gm)).toHaveLength(1);
|
||||
expect(body).toMatch(/^- \*\*Kind\*\*: monorepo$/m);
|
||||
expect(body).toMatch(/^- \*\*Web\*\*: https:\/\/logicsrc\.com$/m);
|
||||
expect(body).toMatch(/^- \*\*Operator\*\*: https:\/\/logicsrc\.com\/\.well-known\/openprofile\.md$/m);
|
||||
for (const layer of [
|
||||
"Languages",
|
||||
"Runtimes",
|
||||
"Interfaces",
|
||||
"Data",
|
||||
"Services",
|
||||
"Modules",
|
||||
"Tooling",
|
||||
"Hosting",
|
||||
"Auth",
|
||||
"Conventions",
|
||||
"Not"
|
||||
]) {
|
||||
expect(body).toMatch(new RegExp(`^## ${layer}$`, "m"));
|
||||
}
|
||||
// every interface this monorepo ships is declared
|
||||
for (const iface of ["Web", "CLI", "TUI", "MCP", "API"]) {
|
||||
expect(body).toMatch(new RegExp(`^### ${iface}$`, "m"));
|
||||
}
|
||||
expect(body).not.toContain(String.fromCharCode(0x2014));
|
||||
});
|
||||
});
|
||||
|
|
@ -14,7 +14,8 @@ describe.each([
|
|||
{ slug: "openabtest", name: "OpenABTest", family: "process" },
|
||||
{ slug: "openfleet", name: "OpenFleet", family: "process" },
|
||||
{ slug: "openrental", name: "OpenRental", family: "catalogs" },
|
||||
{ slug: "openwall", name: "OpenWall", family: "people" }
|
||||
{ slug: "openwall", name: "OpenWall", family: "people" },
|
||||
{ slug: "openstack", name: "OpenStack.md", family: "catalogs" }
|
||||
])("$name public discovery", ({ slug, name, family }) => {
|
||||
it("serves the specification through its family and docs index", () => {
|
||||
expect(familyOfSpec(slug)?.slug).toBe(family);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue