Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: register repository identity in the library catalog (#13456)
Adam Eivy2c4931ee243a
diff --git a/server/lib/README.md b/server/lib/README.mdindex 0701fdf03e..33d1ad7a60 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -501,6 +501,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `githubNotificationPullRequest.js` | `notificationPullRequestTarget`, `notificationPullRequestView` — same-host PR targets and the inbox action eligibility projection; mutations always re-read the forge. || `githubNotificationTriage.js` | `TRIAGE_DECISIONS`, `TRUST_LEVELS`, `MASS_MENTION_THRESHOLD`, `computeThreadTrust`, `spamSignals`, `parseCiBranch`, `decideThread`, `ASSIST_VERDICTS`, `decisionFromVerdict`, `learnedDecisionForAction`, `applyLearnedRule`, `assistAction`, `selectNotificationProvider`, `notificationAgentAccountBinding`, `agentHandoff`, `autopilotHandoff`, `agentRuleScope`, `agentRunPin`, `GENERIC_AGENT_LANE`, `APP_FREE_AGENT_LANES`, `AGENT_RULE_KINDS`, `AGENT_RULE_ACTIONS`, `GENERIC_RULE_KINDS`, `threadAgentKind`, `KIND_SQL`, `normalizeAgentRules`, `ruleAction`, `ruleActionScope`, `PINNED_TRIAGE_RULES` — the GitHub inbox's fixed trust, spam and routing rules plus Assist's verdict enum, learned rules, allowed actions and Private-account provider allow-list, plus agent lanes (with the generic `notification-resolve` lane's trust gate), per-repo automation rules (kind × agent/done/mute/leave, legacy `agent` booleans read as actions) and run-pin precedence; trust comes only from accounts, repo ownership and forge permissions, never from content. || `gitRemote.js` | `getOriginInfo`, `classifyOriginRemote`, `parseGitRemoteUrl`, `readRemoteUrl`, `isUpstreamOwner`, `isUpstreamFullName`, `UPSTREAM_OWNER`/`UPSTREAM_REPO` — safely reads and classifies checkout remotes against PortOS or a caller-supplied canonical upstream. Used by self-update and managed integrations to detect forks. |+| `gitRepositoryIdentity.js` | `readGitCommonDirectory(repoPath)` — fresh canonical Git common-directory identity for repository-scoped ownership; aliases and linked worktrees share identity, independent clones do not, and unreadable evidence returns null. || `gitStaleLock.js` | `gitLockPathFromError`, `isStaleGitLock`, `clearStaleGitLock`, `clearStaleGitLocksIn`, `STALE_GIT_LOCK_MIN_AGE_MS` — recognizes the `*.lock` a KILLED git process left behind and removes it so the caller can retry. A lock under `.git/modules/<submodule>/` is shared by every worktree of the repo, so one dead process wedges submodule checkout install-wide with a bogus "another git process is running". Removal requires a `.lock` path under a `.git` directory (so a malformed message cannot aim the unlink at `yarn.lock`) that is older than 30 minutes — 3x the longest git command PortOS runs (`worktreeManager.WORKTREE_ADD_TIMEOUT_MS`, pinned by a test), which is what keeps it from deleting a LIVE competitor's lock. The threshold is deliberately not a parameter. `clearStaleGitLock(message)` is the reactive form, wired into `services/gitSubmodules.js#updateSubmodule` and `worktreeManager.addWorktreeWithRetry`; `clearStaleGitLocksIn(gitDir)` sweeps ahead of `update.sh`/`update.ps1`, the most likely producer. `scripts/doctor.js` reports one as the blocker. || `repoLinkFields.js` | `deriveRepoLinkFields(url)` / `normalizeRepoLinkFields(link)` / `linkIsRepo(link)` / `repoLinkLabel(link)` — the repository metadata a Brain link carries, plus the dual-write/tolerant-read shim that keeps the pre-multi-host `isGitHubRepo` field names readable across federated peers. || `repoUrl.js` | `parseRepoUrl(url)` → `{ host, provider, owner, repo }` / `isRepoUrl(url)` / `repoCloneUrl(parsed)` / `repoBrowseUrl(parsed)` / `parseGitHubUrl(url)` / `isGitHubRepoUrl(url)` — authoritative "is this a clonable repo URL?" rule, with per-host behavior (subgroup nesting, clone layout) in the `REPO_HOSTS` table. Re-exported by `client/src/lib/repoUrl.js` so the Brain capture boxes reveal the post-clone agent options for exactly the URLs the server will clone. |diff --git a/server/lib/index.js b/server/lib/index.jsindex cd109fdbca..4570870d52 100644--- a/server/lib/index.js+++ b/server/lib/index.js@@ -451,6 +451,7 @@ export * from './gitCommitProbe.js';export * from './gitForge.js';export * from './gitOutputParsers.js';export * from './gitRemote.js';+export * from './gitRepositoryIdentity.js';export * from './gitStaleLock.js';export * from './githubNotificationAudit.js';export * from './githubNotificationParse.js';