Skip to content

feat(project): Implementing project resolution, container template and .env.local/.gitignore scaffolding - #1880

Open
tejaskash wants to merge 11 commits into
refactorfrom
feat/project-foundation
Open

feat(project): Implementing project resolution, container template and .env.local/.gitignore scaffolding#1880
tejaskash wants to merge 11 commits into
refactorfrom
feat/project-foundation

Conversation

@tejaskash

@tejaskash tejaskash commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the hello-world-python-container template for container-based Python projects
  • scaffold new projects with a root .gitignore, agentcore/.env.local, and template README files
  • implement FsProjectManager.resolve() to locate and validate agentcore/agentcore.json from the current directory or its parents
  • distinguish missing projects from invalid project configuration
  • apply withProject middleware to every project subcommand except create

Verification

  • added round-trip create and resolve tests for both project templates
  • added coverage for missing, malformed, and legacy project configurations
  • bun test (554 tests)

@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jul 30, 2026
@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.04%. Comparing base (ec57799) to head (2b84b78).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jul 30, 2026
@tejaskash tejaskash changed the title feat(project): container template, .env.local/.gitignore scaffolding, and project resolution [NOT READY FOR REVIEW] feat(project): container template, .env.local/.gitignore scaffolding, and project resolution Jul 31, 2026
@tejaskash tejaskash changed the title [NOT READY FOR REVIEW] feat(project): container template, .env.local/.gitignore scaffolding, and project resolution feat(project): container template, .env.local/.gitignore scaffolding, and project resolution Jul 31, 2026
@tejaskash
tejaskash force-pushed the feat/project-foundation branch from 0fd7837 to 3c9ec6c Compare July 31, 2026 17:06
@tejaskash tejaskash changed the title feat(project): container template, .env.local/.gitignore scaffolding, and project resolution feat(project): Implementing project resolution, container template and .env.local/.gitignore scaffolding Aug 3, 2026
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
tejaskash force-pushed the feat/project-foundation branch from 93ff214 to 2b84b78 Compare August 3, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants