feat(project): Implementing project resolution, container template and .env.local/.gitignore scaffolding - #1880
Open
tejaskash wants to merge 11 commits into
Open
feat(project): Implementing project resolution, container template and .env.local/.gitignore scaffolding#1880tejaskash wants to merge 11 commits into
tejaskash wants to merge 11 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #1880 +/- ##
============================================
+ Coverage 96.01% 96.04% +0.03%
============================================
Files 211 211
Lines 9837 9916 +79
============================================
+ Hits 9445 9524 +79
Misses 392 392 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tejaskash
force-pushed
the
feat/project-foundation
branch
from
July 31, 2026 17:06
0fd7837 to
3c9ec6c
Compare
Same agent code as the CodeZip template packaged for a Container build: a static uv-based Dockerfile (no render-time conditionals), a .dockerignore rendered from dockerignore.template via the existing ignore-file mechanism, and a Container runtime entry (with dockerfile) in agentcore.json.
Every template now gets a project-root .gitignore (env files, Python/Node artifacts, CLI state, cdk.out) and a commented agentcore/.env.local that agentcore dev will load. Both render from shared *.template assets because npm strips real dotfiles when publishing.
FsProjectManager.resolve now walks up from the given path for the agentcore/agentcore.json marker, validates the spec against the new ProjectSpecSchema (loose, so specs carrying sections we don't read yet still resolve), and returns the widened Project model (rootPath + runtimes). A missing project resolves to undefined; a present-but-broken config throws InvalidProjectConfigError instead of masquerading as 'no project'. withProject now throws a typed NoProjectError and is mounted on every project subcommand except create, which runs where no project exists yet. The search root prefers INIT_CWD since package-manager scripts change process.cwd().
pyproject.toml declares readme = README.md; without the file, uv sync fails the hatchling build inside the container image. A starter README is also just better scaffolding.
TemplateSpec.runtimes is now ProjectRuntime[] so template/schema drift is a compile error and create() returns the spec directly instead of re-parsing it through zod.
It was a private bare-Error subclass inside FsReadWriteJson (with a TODO to model it properly). It now extends AgentCoreCLIError alongside the other typed errors, and FsProjectManager.resolve catches it by type instead of sniffing error.cause.
NestedProjectError, InvalidProjectConfigError, ProjectFileExistsError, EmbeddedAssetNotFoundError, InvalidEnvironmentError, and the runtime invoke errors were defined next to their throw sites. All typed errors now live in src/errors like the telemetry model expects; the invoke errors.ts file is gone.
create previously wrote the spec as an untyped object while resolve validated a hand-rolled loose slice — the two were held together only by the round-trip test. agentcoreSpec() now parses through ProjectSpecSchema before writing, and the schema is strict: version and managedBy are modeled, unknown keys (including typos like runtmes) fail loudly instead of parsing as an empty project. New sections get added to the schema as the CLI grows support for them.
tejaskash
force-pushed
the
feat/project-foundation
branch
from
August 3, 2026 21:16
93ff214 to
2b84b78
Compare
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.
Summary
hello-world-python-containertemplate for container-based Python projects.gitignore,agentcore/.env.local, and template README filesFsProjectManager.resolve()to locate and validateagentcore/agentcore.jsonfrom the current directory or its parentswithProjectmiddleware to every project subcommand exceptcreateVerification
bun test(554 tests)