Repository navigation
Serve every lambda as a git repository - #108
Merged
Merged
Conversation
A lambda is cloned from /editor/{privateKey}/{name}.git by whoever holds
its editor key, and from /source/{publicKey}.git by anybody while its
source is published. The repository is the project the lambda is exported
as, made for a repository: every version a commit of main tagged v{n},
every feature a branch, AGENTS.md telling an agent how to work in it.
A commit pushed to main becomes the next version - compiled first and
refused when it does not compile - and a branch pushed starts or replaces
a feature with its preview online; -o deploy and -o merge put it online.
Changes to the files the platform puts around the lambda are refused.
Commits are made when the repository is read and kept below
/data/git/{lambda}, so they never change once anybody saw them. Served by
GenHTTP.Modules.Git, the answer written away from the reactor.
The editor offers the clone address in the full view, the /source page in
a Code menu beside the star; docs, README, guide and MCP say how.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…low pruned versions A branch whose first push was refused after its feature was started - over the tier's allowance, say - removes that feature again. A version committed after the ones before it were pruned unread follows the newest commit made before them, so a clone made earlier fetches it as the continuation of its history; GenHTTP.Modules.Git 0.1.1 keeps such a clone complete rather than cutting it off as shallow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every lambda is now a git repository: whoever holds the editor key clones it, works on it with their own tools and coding agent, and pushes - and anybody clones a published source.
How it works
The repository is the lambda's project. It is the export's project, adjusted for a repository:
Project.csislambda.cs(the body ofBuildAsync(), the method the platform runs the snippet in), the other.csfiles,assets/,docs/andtests/(from.lambda/). Around them sit the platform's files:Program.cs, the.csproj,Platform/,Dockerfile,.gitignore,.dockerignore,AGENTS.md,CLAUDE.md(@AGENTS.md), andLICENSEwhile the source is published. A clone builds and runs withdotnet run, and a test clones every demo and builds it.AGENTS.mdtells an agent how to work in the repository and carries the platform's rules in git's terms: relative paths, never waiting for a task, the database, secrets, docs and tests in proportion, pages meant to be found, no polling, the link back.History.
mainis the newest version, every version a commit taggedv{n}, every feature a branch (features.branch, migration V19). The branch name comes from the feature's name in git's characters, or is the name that was pushed; renaming the feature keeps it. The published source serves the same commits, without the features' branches, and their commits aren't fetchable by id either.Pushing to main. Each commit becomes the next version, with the first line of its message as the change and the rest as the specification (origin
git). History is linear only: no force pushes, merge commits or deletion; a version saved meanwhile elsewhere means "fetch first". The newest commit is compiled first, and the push is refused if it doesn't compile, with errors pointing at the right place in the repository, e.g.Project.cs(47,42).-o deployputs the newest version online. A feature whose branch is now inmaincounts as merged.Pushing a branch. A push starts or replaces a feature, based on the newest version among its commits, and puts its preview online, which no visitor sees.
-o mergemerges it as one version,git push origin branch:mainas a version per commit, and deleting the branch deletes the feature. A feature changed in the editor since the client fetched refuses the push rather than losing that change.Refused, with the reason and the fix: changes to the platform's files, files that have no place in a lambda (a root
README.md), executables and links, tags, extra members inclass Project, and anything the services refuse a save for (sizes, names, demos). Every push goes throughIMetaServiceandIFeatureService, so their rules hold.The answers never contain the editor key.
Decisions worth a look
All of these are recorded in CLAUDE.md (new section Git):
/data/git/{lambda}and never regenerated from the version, so a newer platform can't rewrite anybody's history. Saving in the editor, the API or MCP is untouched, and a lambda nobody clones costs nothing. Commits for pruned versions are collected; a clone is then shallow from that point on.async. A commit whoselambda.csdidn't change keeps the previousProject.cs, so a class someone formatted their own way survives a save in the editor.main, refusing more commits in one push than the tier keeps versions ("squash them").-ooptions only with an actual update. A version already pushed is deployed in the editor or through the API, and the push answer says so.Infrastructure/OffloadedContent). At most two pushes are applied at once, each up toLAMBDA_GIT_MAX_PUSH_BYTES(256 MB)./buildsay nothing about it.UI
The full view has a Clone popover on the overview (the repository's front page), beside the code, and in a draft, which also shows its branch. Versions pushed with git get a small branch mark.
/sourcegets a GitHub-like Code menu next to the star: clone, then the version as ZIP, then how to run it. On phones the popover keeps inside the screen./docsgains Working on it with git, and/shipthe question Can I push to it with git?. All 12 languages are translated through the usual pipeline, with glossary entries for clone, commit, branch and push.For agents
create_lambdaandread_lambdaanswer withgitUrl, and features name theirbranch.platform_guidehas agitsection, and the MCP instructions add one line.gitPathon the lambda and on a published source, andbranchon a feature.Services/Git), the routes and the setting.Tests
The 41 new tests in
tests/.../Gituse the real git client, which checks every object it receives (transfer.fsckObjects):-o deploy, branches with previews,-o merge,branch:main, deletion, races with the editor;Project.csround-tripping for every demo.The full suite passes against the released 0.1.1: 727 tests. The frontend build and the translations check pass too; the one remark is one that main already has.
Follow-ups
/sourcecode view still shows the export'sProject.cs(Build()), while a clone hasBuildAsync(). Serving the source pages from the commits would make them identical.LICENSEis in the commits made while the source is published, so commits made before that don't carry it.🤖 Generated with Claude Code