Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 10 additions & 4 deletions tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,26 @@ Use this guide to navigate all tutorial tracks, understand structure rules, and
<<<<<<< HEAD
| Tutorial directories | 188 |
| Tutorial markdown files | 1705 |
| Tutorial markdown lines | 881,469 |
| Tutorial markdown lines | 996,366 |
=======
<<<<<<< HEAD
| Tutorial directories | 188 |
| Tutorial markdown files | 1705 |
| Tutorial markdown lines | 881,469 |
| Tutorial markdown lines | 996,366 |
=======
<<<<<<< HEAD
| Tutorial directories | 188 |
| Tutorial markdown files | 1705 |
| Tutorial markdown lines | 881,469 |
| Tutorial markdown lines | 996,366 |
=======
<<<<<<< HEAD
| Tutorial directories | 188 |
| Tutorial markdown files | 1705 |
| Tutorial markdown lines | 881,469 |
| Tutorial markdown lines | 996,366 |
=======
| Tutorial directories | 188 |
| Tutorial markdown files | 1705 |
| Tutorial markdown lines | 996,366 |

## Source Verification Snapshot

Expand All @@ -50,6 +55,7 @@ Repository-source verification run against tutorial index references (GitHub API
>>>>>>> origin/main
>>>>>>> origin/main
>>>>>>> origin/main
>>>>>>> origin/main

## Content Structure Patterns

Expand Down
153 changes: 152 additions & 1 deletion tutorials/openhands-tutorial/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ parent: OpenHands Tutorial

# Chapter 1: Getting Started with OpenHands

Welcome to **Chapter 1: Getting Started with OpenHands**. In this part of **OpenHands Tutorial: Autonomous Software Engineering Workflows**, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.


> Install OpenHands, understand its architecture, and execute your first autonomous coding task.

## Overview
Expand Down Expand Up @@ -565,4 +568,152 @@ Next, we'll explore **basic operations** - file manipulation, command execution,

**Ready for the next chapter?** [Chapter 2: Basic Operations](02-basic-operations.md)

*Generated for [Awesome Code Docs](https://github.com/johnxie/awesome-code-docs)*
*Generated for [Awesome Code Docs](https://github.com/johnxie/awesome-code-docs)*

## Depth Expansion Playbook

<!-- depth-expansion-v2 -->

This chapter is expanded to v1-style depth for production-grade learning and implementation quality.

### Strategic Context

- tutorial: **OpenHands Tutorial: Autonomous Software Engineering Workflows**
- tutorial slug: **openhands-tutorial**
- chapter focus: **Chapter 1: Getting Started with OpenHands**
- system context: **Openhands Tutorial**
- objective: move from surface-level usage to repeatable engineering operation

### Architecture Decomposition

1. Define the runtime boundary for `Chapter 1: Getting Started with OpenHands`.
2. Separate control-plane decisions from data-plane execution.
3. Capture input contracts, transformation points, and output contracts.
4. Trace state transitions across request lifecycle stages.
5. Identify extension hooks and policy interception points.
6. Map ownership boundaries for team and automation workflows.
7. Specify rollback and recovery paths for unsafe changes.
8. Track observability signals for correctness, latency, and cost.

### Operator Decision Matrix

| Decision Area | Low-Risk Path | High-Control Path | Tradeoff |
|:--------------|:--------------|:------------------|:---------|
| Runtime mode | managed defaults | explicit policy config | speed vs control |
| State handling | local ephemeral | durable persisted state | simplicity vs auditability |
| Tool integration | direct API use | mediated adapter layer | velocity vs governance |
| Rollout method | manual change | staged + canary rollout | effort vs safety |
| Incident response | best effort logs | runbooks + SLO alerts | cost vs reliability |

### Failure Modes and Countermeasures

| Failure Mode | Early Signal | Root Cause Pattern | Countermeasure |
|:-------------|:-------------|:-------------------|:---------------|
| stale context | inconsistent outputs | missing refresh window | enforce context TTL and refresh hooks |
| policy drift | unexpected execution | ad hoc overrides | centralize policy profiles |
| auth mismatch | 401/403 bursts | credential sprawl | rotation schedule + scope minimization |
| schema breakage | parser/validation errors | unmanaged upstream changes | contract tests per release |
| retry storms | queue congestion | no backoff controls | jittered backoff + circuit breakers |
| silent regressions | quality drop without alerts | weak baseline metrics | eval harness with thresholds |

### Implementation Runbook

1. Establish a reproducible baseline environment.
2. Capture chapter-specific success criteria before changes.
3. Implement minimal viable path with explicit interfaces.
4. Add observability before expanding feature scope.
5. Run deterministic tests for happy-path behavior.
6. Inject failure scenarios for negative-path validation.
7. Compare output quality against baseline snapshots.
8. Promote through staged environments with rollback gates.
9. Record operational lessons in release notes.

### Quality Gate Checklist

- [ ] chapter-level assumptions are explicit and testable
- [ ] API/tool boundaries are documented with input/output examples
- [ ] failure handling includes retry, timeout, and fallback policy
- [ ] security controls include auth scopes and secret rotation plans
- [ ] observability includes logs, metrics, traces, and alert thresholds
- [ ] deployment guidance includes canary and rollback paths
- [ ] docs include links to upstream sources and related tracks
- [ ] post-release verification confirms expected behavior under load

### Source Alignment

- [OpenHands Repository](https://github.com/OpenHands/OpenHands)
- [OpenHands Docs](https://docs.openhands.dev/)
- [OpenHands Releases](https://github.com/OpenHands/OpenHands/releases)

### Cross-Tutorial Connection Map

- [OpenClaw Tutorial](../openclaw-tutorial/)
- [Cline Tutorial](../cline-tutorial/)
- [Roo Code Tutorial](../roo-code-tutorial/)
- [Continue Tutorial](../continue-tutorial/)
- [Chapter 1: Getting Started](01-getting-started.md)

### Advanced Practice Exercises

1. Build a minimal end-to-end implementation for `Chapter 1: Getting Started with OpenHands`.
2. Add instrumentation and measure baseline latency and error rate.
3. Introduce one controlled failure and confirm graceful recovery.
4. Add policy constraints and verify they are enforced consistently.
5. Run a staged rollout and document rollback decision criteria.

### Review Questions

1. Which execution boundary matters most for this chapter and why?
2. What signal detects regressions earliest in your environment?
3. What tradeoff did you make between delivery speed and governance?
4. How would you recover from the highest-impact failure mode?
5. What must be automated before scaling to team-wide adoption?

## What Problem Does This Solve?

Most teams struggle here because the hard part is not writing more code, but deciding clear boundaries for `print`, `result`, `openhands` so behavior stays predictable as complexity grows.

In practical terms, this chapter helps you avoid three common failures:

- coupling core logic too tightly to one implementation path
- missing the handoff boundaries between setup, execution, and validation
- shipping changes without clear rollback or observability strategy

After working through this chapter, you should be able to reason about `Chapter 1: Getting Started with OpenHands` as an operating subsystem inside **OpenHands Tutorial: Autonomous Software Engineering Workflows**, with explicit contracts for inputs, state transitions, and outputs.

Use the implementation notes around `task`, `workspace`, `OpenHands` as your checklist when adapting these patterns to your own repository.

## How it Works Under the Hood

Under the hood, `Chapter 1: Getting Started with OpenHands` usually follows a repeatable control path:

1. **Context bootstrap**: initialize runtime config and prerequisites for `print`.
2. **Input normalization**: shape incoming data so `result` receives stable contracts.
3. **Core execution**: run the main logic branch and propagate intermediate state through `openhands`.
4. **Policy and safety checks**: enforce limits, auth scopes, and failure boundaries.
5. **Output composition**: return canonical result payloads for downstream consumers.
6. **Operational telemetry**: emit logs/metrics needed for debugging and performance tuning.

When debugging, walk this sequence in order and confirm each stage has explicit success/failure conditions.

## Source Walkthrough

Use the following upstream sources to verify implementation details while reading this chapter:

- [OpenHands Repository](https://github.com/OpenHands/OpenHands)
Why it matters: authoritative reference on `OpenHands Repository` (github.com).
- [OpenHands Docs](https://docs.openhands.dev/)
Why it matters: authoritative reference on `OpenHands Docs` (docs.openhands.dev).
- [OpenHands Releases](https://github.com/OpenHands/OpenHands/releases)
Why it matters: authoritative reference on `OpenHands Releases` (github.com).

Suggested trace strategy:
- search upstream code for `print` and `result` to map concrete implementation paths
- compare docs claims against actual runtime/config code before reusing patterns in production

## Chapter Connections

- [Tutorial Index](index.md)
- [Next Chapter: Chapter 2: Basic Operations - Files, Commands, and Environments](02-basic-operations.md)
- [Main Catalog](../../README.md#-tutorial-catalog)
- [A-Z Tutorial Directory](../../discoverability/tutorial-directory.md)
55 changes: 54 additions & 1 deletion tutorials/openhands-tutorial/02-basic-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ parent: OpenHands Tutorial

# Chapter 2: Basic Operations - Files, Commands, and Environments

Welcome to **Chapter 2: Basic Operations - Files, Commands, and Environments**. In this part of **OpenHands Tutorial: Autonomous Software Engineering Workflows**, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.


> Master file operations, command execution, environment management, and workspace navigation with OpenHands.

## Overview
Expand Down Expand Up @@ -601,4 +604,54 @@ Next, we'll explore **code generation** - OpenHands' ability to create high-qual

**Ready for the next chapter?** [Chapter 3: Code Generation](03-code-generation.md)

*Generated for [Awesome Code Docs](https://github.com/johnxie/awesome-code-docs)*
*Generated for [Awesome Code Docs](https://github.com/johnxie/awesome-code-docs)*

## What Problem Does This Solve?

Most teams struggle here because the hard part is not writing more code, but deciding clear boundaries for `management`, `Create`, `OpenHands` so behavior stays predictable as complexity grows.

In practical terms, this chapter helps you avoid three common failures:

- coupling core logic too tightly to one implementation path
- missing the handoff boundaries between setup, execution, and validation
- shipping changes without clear rollback or observability strategy

After working through this chapter, you should be able to reason about `Chapter 2: Basic Operations - Files, Commands, and Environments` as an operating subsystem inside **OpenHands Tutorial: Autonomous Software Engineering Workflows**, with explicit contracts for inputs, state transitions, and outputs.

Use the implementation notes around `environment`, `file`, `operations` as your checklist when adapting these patterns to your own repository.

## How it Works Under the Hood

Under the hood, `Chapter 2: Basic Operations - Files, Commands, and Environments` usually follows a repeatable control path:

1. **Context bootstrap**: initialize runtime config and prerequisites for `management`.
2. **Input normalization**: shape incoming data so `Create` receives stable contracts.
3. **Core execution**: run the main logic branch and propagate intermediate state through `OpenHands`.
4. **Policy and safety checks**: enforce limits, auth scopes, and failure boundaries.
5. **Output composition**: return canonical result payloads for downstream consumers.
6. **Operational telemetry**: emit logs/metrics needed for debugging and performance tuning.

When debugging, walk this sequence in order and confirm each stage has explicit success/failure conditions.

## Source Walkthrough

Use the following upstream sources to verify implementation details while reading this chapter:

- [OpenHands Repository](https://github.com/OpenHands/OpenHands)
Why it matters: authoritative reference on `OpenHands Repository` (github.com).
- [OpenHands Docs](https://docs.openhands.dev/)
Why it matters: authoritative reference on `OpenHands Docs` (docs.openhands.dev).
- [OpenHands Releases](https://github.com/OpenHands/OpenHands/releases)
Why it matters: authoritative reference on `OpenHands Releases` (github.com).

Suggested trace strategy:
- search upstream code for `management` and `Create` to map concrete implementation paths
- compare docs claims against actual runtime/config code before reusing patterns in production

## Chapter Connections

- [Tutorial Index](index.md)
- [Previous Chapter: Chapter 1: Getting Started with OpenHands](01-getting-started.md)
- [Next Chapter: Chapter 3: Code Generation - Creating Production-Ready Code](03-code-generation.md)
- [Main Catalog](../../README.md#-tutorial-catalog)
- [A-Z Tutorial Directory](../../discoverability/tutorial-directory.md)
55 changes: 54 additions & 1 deletion tutorials/openhands-tutorial/03-code-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ parent: OpenHands Tutorial

# Chapter 3: Code Generation - Creating Production-Ready Code

Welcome to **Chapter 3: Code Generation - Creating Production-Ready Code**. In this part of **OpenHands Tutorial: Autonomous Software Engineering Workflows**, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.


> Master OpenHands' code generation capabilities for functions, classes, complete applications, and production-ready systems.

## Overview
Expand Down Expand Up @@ -660,4 +663,54 @@ Next, we'll explore **bug fixing** - OpenHands' ability to identify, diagnose, a

**Ready for the next chapter?** [Chapter 4: Bug Fixing](04-bug-fixing.md)

*Generated for [Awesome Code Docs](https://github.com/johnxie/awesome-code-docs)*
*Generated for [Awesome Code Docs](https://github.com/johnxie/awesome-code-docs)*

## What Problem Does This Solve?

Most teams struggle here because the hard part is not writing more code, but deciding clear boundaries for `Include`, `testing`, `management` so behavior stays predictable as complexity grows.

In practical terms, this chapter helps you avoid three common failures:

- coupling core logic too tightly to one implementation path
- missing the handoff boundaries between setup, execution, and validation
- shipping changes without clear rollback or observability strategy

After working through this chapter, you should be able to reason about `Chapter 3: Code Generation - Creating Production-Ready Code` as an operating subsystem inside **OpenHands Tutorial: Autonomous Software Engineering Workflows**, with explicit contracts for inputs, state transitions, and outputs.

Use the implementation notes around `generation`, `documentation`, `Create` as your checklist when adapting these patterns to your own repository.

## How it Works Under the Hood

Under the hood, `Chapter 3: Code Generation - Creating Production-Ready Code` usually follows a repeatable control path:

1. **Context bootstrap**: initialize runtime config and prerequisites for `Include`.
2. **Input normalization**: shape incoming data so `testing` receives stable contracts.
3. **Core execution**: run the main logic branch and propagate intermediate state through `management`.
4. **Policy and safety checks**: enforce limits, auth scopes, and failure boundaries.
5. **Output composition**: return canonical result payloads for downstream consumers.
6. **Operational telemetry**: emit logs/metrics needed for debugging and performance tuning.

When debugging, walk this sequence in order and confirm each stage has explicit success/failure conditions.

## Source Walkthrough

Use the following upstream sources to verify implementation details while reading this chapter:

- [OpenHands Repository](https://github.com/OpenHands/OpenHands)
Why it matters: authoritative reference on `OpenHands Repository` (github.com).
- [OpenHands Docs](https://docs.openhands.dev/)
Why it matters: authoritative reference on `OpenHands Docs` (docs.openhands.dev).
- [OpenHands Releases](https://github.com/OpenHands/OpenHands/releases)
Why it matters: authoritative reference on `OpenHands Releases` (github.com).

Suggested trace strategy:
- search upstream code for `Include` and `testing` to map concrete implementation paths
- compare docs claims against actual runtime/config code before reusing patterns in production

## Chapter Connections

- [Tutorial Index](index.md)
- [Previous Chapter: Chapter 2: Basic Operations - Files, Commands, and Environments](02-basic-operations.md)
- [Next Chapter: Chapter 4: Bug Fixing - Autonomous Debugging and Resolution](04-bug-fixing.md)
- [Main Catalog](../../README.md#-tutorial-catalog)
- [A-Z Tutorial Directory](../../discoverability/tutorial-directory.md)
Loading